@@ -553,23 +553,6 @@ protected function tokenize($string)
553
553
$ lastNotEmptyToken = ($ newStackPtr - 1 );
554
554
}
555
555
556
- /*
557
- For Explicit Octal Notation prior to PHP 8.1 we need to combine the
558
- T_NUMBER and T_STRING token values into a single token value, and
559
- then ignore the T_STRING token.
560
- */
561
-
562
- if (PHP_VERSION_ID < 80100
563
- && $ tokenIsArray === true && $ token [1 ] === '0 '
564
- && (isset ($ tokens [($ stackPtr + 1 )]) === true
565
- && is_array ($ tokens [($ stackPtr + 1 )]) === true
566
- && $ tokens [($ stackPtr + 1 )][0 ] === T_STRING
567
- && $ tokens [($ stackPtr + 1 )][1 ][0 ] === 'o ' )
568
- ) {
569
- $ token [1 ] .= $ tokens [($ stackPtr + 1 )][1 ];
570
- $ tokens [($ stackPtr + 1 )] = '' ;
571
- }
572
-
573
556
/*
574
557
If we are using \r\n newline characters, the \r and \n are sometimes
575
558
split over two tokens. This normally occurs after comments. We need
@@ -663,6 +646,29 @@ protected function tokenize($string)
663
646
}//end if
664
647
}//end if
665
648
649
+ /*
650
+ For Explicit Octal Notation prior to PHP 8.1 we need to combine the
651
+ T_LNUMBER and T_STRING token values into a single token value, and
652
+ then ignore the T_STRING token.
653
+ */
654
+
655
+ if (PHP_VERSION_ID < 80100
656
+ && $ tokenIsArray === true && $ token [1 ] === '0 '
657
+ && (isset ($ tokens [($ stackPtr + 1 )]) === true
658
+ && is_array ($ tokens [($ stackPtr + 1 )]) === true
659
+ && $ tokens [($ stackPtr + 1 )][0 ] === T_STRING
660
+ && strtolower ($ tokens [($ stackPtr + 1 )][1 ][0 ]) === 'o ' )
661
+ ) {
662
+ $ finalTokens [$ newStackPtr ] = [
663
+ 'code ' => T_LNUMBER ,
664
+ 'type ' => 'T_LNUMBER ' ,
665
+ 'content ' => $ token [1 ] .= $ tokens [($ stackPtr + 1 )][1 ],
666
+ ];
667
+ $ stackPtr ++;
668
+ $ newStackPtr ++;
669
+ continue ;
670
+ }
671
+
666
672
/*
667
673
PHP 8.1 introduced two dedicated tokens for the & character.
668
674
Retokenizing both of these to T_BITWISE_AND, which is the
0 commit comments