Bug #71086 [Com]: Invalid numeric literal parse error within highlight_string() function
| From: | nospam at mckenzies dot net | Date: | Thu, 12 Dec 2019 15:57:26 +0000 |
| Subject: | Bug #71086 [Com]: Invalid numeric literal parse error within highlight_string() function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224252@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71086&edit=1
ID: 71086
Comment by: nospam at mckenzies dot net
Reported by: chris at xenforo dot com
Summary: Invalid numeric literal parse error within
highlight_string() function
Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Ubuntu 14.04 x64
PHP Version: 7.0Git-2015-12-10 (Git)
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
This is ridiculous! Bad regression, from working to PARSE ERROR! Why not warning or deprecated???
Previous Comments:
------------------------------------------------------------------------
[2016-07-20 11:34:50] davey@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fd3ece8578326410ccd045332c57e6fec5a88bad
Log: Fix bug #71086
------------------------------------------------------------------------
[2015-12-11 15:06:57] nikic@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fd3ece8578326410ccd045332c57e6fec5a88bad
Log: Fix bug #71086
------------------------------------------------------------------------
[2015-12-10 21:06:43] chris at xenforo dot com
Description:
------------
I have reproduced this issue with PHP 7.0 stable and have since updated to:
PHP 7.0.2-dev (cli) (built: Dec 9 2015 20:09:53) ( NTS )
If you test the script below, you will see a parse error, "Invalid numeric literal".
Although, technically, the code used within highlight_string function below is indeed invalid, I
don't believe this should actually manifest itself as a parse error. After all, you can throw
pretty much anything in there, valid or invalid, and not otherwise get any problems, so a parse
error here for this specific case seems unexpected.
Test script:
---------------
<?php
$highlightedString = highlight_string("<?php \n 09;", true);
var_dump($highlightedString);
?>
Expected result:
----------------
The parse error should be suppressed.
Actual result:
--------------
ParseError: Invalid numeric literal
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71086&edit=1