Bug #80225 [Com]: broken namespace usage in eval code
| From: | remi@php.net | Date: | Mon, 12 Oct 2020 14:40:34 +0000 |
| Subject: | Bug #80225 [Com]: broken namespace usage in eval code | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229581@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80225&edit=1
ID: 80225
Comment by: remi@php.net
Reported by: remi@php.net
Summary: broken namespace usage in eval code
Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: GNU/Linux
PHP Version: 8.0.0rc1
Block user comment: N
Private report: N
New Comment:
Thanks for the quick fix.
(for memory was affecting mockery/mockery).
Previous Comments:
------------------------------------------------------------------------
[2020-10-12 14:35:55] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f9b7609d17694c5b5d5bba6321b27944220566be
Log: Fixed bug #80225
------------------------------------------------------------------------
[2020-10-12 14:30:53] nikic@php.net
Basically same as https://3v4l.org/bBCrm. No idea if
that's "right", but I guess we can just match the previous behavior.
------------------------------------------------------------------------
[2020-10-12 13:47:03] remi@php.net
Description:
------------
Looks like a regression in 8.0.0rc1
Was working in previous versions (7.2, 7.3, 7.4 and up to 8.0.0beta4)
https://3v4l.org/gWW0K
Test script:
---------------
<?php
eval("echo \"One\n\";\n");
eval("namespace Bar;\n\necho \"Two\n\";\n");
eval("?><?php\necho \"Three\n\";\n");
eval("?><?php\nnamespace Bar;\n\necho \"Four\n\";\n");
Expected result:
----------------
One
Two
Three
Four
Actual result:
--------------
One
Two
Three
Fatal error: Namespace declaration statement has to be the very first statement or after any declare
call in the script in /in/gWW0K(6) : eval()'d code on line 2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80225&edit=1