Skip to content

"instanceof" and "not" precedence #1153

Open
@hugues-koolsol

Description

@hugues-koolsol

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions