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

"instanceof" and "not" precedence #1153

Open
hugues-koolsol opened this issue Jan 19, 2025 · 0 comments
Open

"instanceof" and "not" precedence #1153

hugues-koolsol opened this issue Jan 19, 2025 · 0 comments

Comments

@hugues-koolsol
Copy link

Hello
First of all, Thank You very much for your work.

I have a little problem with a test combining the not and the instanceof operators :

if( !$stmt instanceof a ){
/* do something */
}

outputs an ast that gives something which is like

if( !($stmt) instanceof a){
/**/
}

and it should give something like

if( !($stmt instanceof a ) ){
/**/
}
Because the priority of instanceof is higher than the "not" according to the php documentation there
https://www.php.net/manual/en/language.operators.precedence.php

I can go around this little problem but it may be useful to you

Bye & thank you
Hugues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant