Skip to content

Commit b6b15fc

Browse files
theodorejbnikic
authored andcommitted
Fix #77993: Wrong parse error for invalid hex literal on Windows
If a PHP file contains an invalid hex literal such as `0x_10`, the expected error is `Parse error: syntax error, unexpected 'x_10' (T_STRING) in %s on line %d`. This already worked correctly on Linux, but on Windows prior to this patch a different error was produced: `Parse error: Invalid numeric literal in %s on line %d`.
1 parent f95b27c commit b6b15fc

File tree

4 files changed

+4708
-4703
lines changed

4 files changed

+4708
-4703
lines changed

Zend/tests/bug77993.phpt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--TEST--
2+
Bug #77993 (Wrong parse error for invalid hex literal on Windows)
3+
--FILE--
4+
<?php
5+
0xg10;
6+
--EXPECTF--
7+
Parse error: syntax error, unexpected 'xg10' (T_STRING) in %s on line %d

0 commit comments

Comments
 (0)