|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-09-24 06:56 UTC] nikic@php.net
[2017-09-24 06:56 UTC] nikic@php.net
-Status: Open
+Status: Closed
[2017-09-24 06:57 UTC] nikic@php.net
-Assigned To:
+Assigned To: nikic
[2017-09-24 06:57 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ If two ParseErrors are thrown in the same request (e.g. by using eval or the ast extension), the replacement of the token name with the token value is only performed for the first error. This happens because the CG(parse_error) global does not get reset if the ParseError exception is caught. Test script: --------------- <?php $code = <<<'CODE' function test_missing_semicolon() : string { $x = [] FOO } CODE; try { eval($code); } catch (ParseError $e) { var_dump($e->getMessage()); } try { eval($code); } catch (ParseError $e) { var_dump($e->getMessage()); } Expected result: ---------------- string(41) "syntax error, unexpected 'FOO' (T_STRING)" string(41) "syntax error, unexpected 'FOO' (T_STRING)" Actual result: -------------- string(41) "syntax error, unexpected 'FOO' (T_STRING)" string(46) "syntax error, unexpected identifier (T_STRING)"