PHP compatibility - mattacosta/php-parser GitHub Wiki

These are intentional differences from PHP. Ideally, this should only include deprecated features that do not see widespread use.

Expressions

The instanceof operator is non-associative, like it's supposed to be.

Before:

PHP always returns false since a boolean is never an instance of a type.

$a instanceof A instanceof B;  // Works!

After:

An error is generated if an operand is preceded and followed by an instanceof operator.