Skip to content

Commit 8a6979d

Browse files
author
MarkBaker
committed
Unit tests to verify that the PHP 7.4 underscore in numeric values still works correctly with Explicit octal values when they have to be backfilled
1 parent 8ada8fc commit 8a6979d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/Core/Tokenizer/BackfillNumericSeparatorTest.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ $foo = 0b0101_1111;
3434
/* testOctal */
3535
$foo = 0137_041;
3636

37+
/* testExplicitOctal (Introduced in PHP 8.1) */
38+
$foo = 0o137_041;
39+
3740
/* testIntMoreThanMax */
3841
$foo = 10_223_372_036_854_775_807;
3942

tests/Core/Tokenizer/BackfillNumericSeparatorTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ public function dataTestBackfill()
132132
'value' => '0137_041',
133133
],
134134
],
135+
[
136+
[
137+
'marker' => '/* testExplicitOctal (Introduced in PHP 8.1) */',
138+
'type' => 'T_LNUMBER',
139+
'value' => '0o137_041',
140+
],
141+
],
135142
[
136143
[
137144
'marker' => '/* testIntMoreThanMax */',

0 commit comments

Comments
 (0)