Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cast precedence #172

Closed
ichiriac opened this issue Aug 17, 2018 · 6 comments
Closed

cast precedence #172

ichiriac opened this issue Aug 17, 2018 · 6 comments
Assignees
Labels
AST bug high-pri High Priority bug

Comments

@ichiriac
Copy link
Member

Handle cast precendence :

<?php
$a = (string)$foo . $a;
// actual behaviour
$a = (string)($foo . $a);
// expected behaviour
$a = ((string)$foo) . $a;

Cast includes function calls, object operators, arrays.

@alexander-akait
Copy link
Collaborator

@ichiriac Can we solve this problem in near future. When we introduce better print parens (based on parenthesizedExpression) login in prettier it is output a lot of bugs 😞

@ichiriac
Copy link
Member Author

yes, sorry, I had not much time to work on php-parter later - I'll be back soon

@alexander-akait
Copy link
Collaborator

Also problem with retif:

(bool) $var ? 1 : 2;
(bool) ($var ? 1 : 2);

@alexander-akait
Copy link
Collaborator

Also same problem for silence node. Related #195

@ichiriac
Copy link
Member Author

this one is fixed, it handles every bin & retif statements

@ichiriac
Copy link
Member Author

ichiriac commented Jan 7, 2019

released in 3.0.0-prerelease.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AST bug high-pri High Priority bug
Projects
None yet
Development

No branches or pull requests

2 participants