Bug #70929 [NEW]: create_function regression when parse error present
| From: | bishop@php.net | Date: | Tue, 17 Nov 2015 18:39:13 +0000 |
| Subject: | Bug #70929 [NEW]: create_function regression when parse error present | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-197300@lists.php.net to get a copy of this message | ||
From: bishop@php.net
Operating system:
PHP version: 7.0Git-2015-11-17 (Git)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:create_function regression when parse error present
Description:
------------
In PHP versions 5.3.19 - 5.6.15, a parse error in create_function
returns false, per the manual:
> If there is a parse error in the evaluated code, eval() returns FALSE
and
> execution of the following code continues normally.
As of PHP 7, this outputs only a parse error and terminates the script.
See https://3v4l.org/apEOR#v5319
Test script:
---------------
<?php
$a = create_function('', 'return (return;);');
var_dump($a, 'here');
Expected result:
----------------
Parse error: syntax error, unexpected 'return' (T_RETURN) in %s :
runtime-created function on line %d
bool(false)
string(4) "here"
Actual result:
--------------
Parse error: syntax error, unexpected 'return' (T_RETURN) in %s :
runtime-created function on line %d
--
Edit bug report at https://bugs.php.net/bug.php?id=70929&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70929&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70929&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70929&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70929&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70929&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70929&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70929&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70929&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70929&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70929&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70929&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70929&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70929&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70929&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70929&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70929&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70929&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70929&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70929&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70929&r=mysqlcfg