Bug #80225 [NEW]: broken namespace usage in eval code
| From: | remi@php.net | Date: | Mon, 12 Oct 2020 13:47:03 +0000 |
| Subject: | Bug #80225 [NEW]: broken namespace usage in eval code | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-229576@lists.php.net to get a copy of this message | ||
From: remi
Operating system: GNU/Linux
PHP version: 8.0.0rc1
Package: Scripting Engine problem
Bug Type: Bug
Bug description:broken namespace usage in eval code
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 bug report at https://bugs.php.net/bug.php?id=80225&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80225&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80225&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80225&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80225&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80225&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80225&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80225&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80225&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80225&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80225&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80225&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80225&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80225&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80225&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80225&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80225&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80225&r=mysqlcfg