- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
The exponentiation arithmetic operator in PHP is **
, and only exists since PHP 5.6
The ^
operator is only the bitwise XOR operator.
See:
http://php.net/manual/en/language.operators.arithmetic.php
http://php.net/manual/en/language.operators.bitwise.php
The wrong code is here: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Tokenizers/PHP.php#L1307
case '^': $newToken['type'] = 'T_POWER'; break;
I'm not familiar enough with PHP_CodeSniffer's code yet, so I cannot make a PR now, but I'm sure that this is a tokenizer bug.