Skip to content

Commit

Permalink
Fix #77993: Wrong parse error for invalid hex literal on Windows
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
theodorejb authored and nikic committed May 13, 2019
1 parent f95b27c commit b6b15fc
Show file tree
Hide file tree
Showing 4 changed files with 4,708 additions and 4,703 deletions.
7 changes: 7 additions & 0 deletions Zend/tests/bug77993.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--TEST--
Bug #77993 (Wrong parse error for invalid hex literal on Windows)
--FILE--
<?php
0xg10;
--EXPECTF--
Parse error: syntax error, unexpected 'xg10' (T_STRING) in %s on line %d

0 comments on commit b6b15fc

Please sign in to comment.