Req #77525 [NEW]: Some fatal errors should be `CompileError`s
| From: | qwertyasdfg99 at gmail dot com | Date: | Sat, 26 Jan 2019 10:13:16 +0000 |
| Subject: | Req #77525 [NEW]: Some fatal errors should be `CompileError`s | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-219224@lists.php.net to get a copy of this message | ||
From: qwertyasdfg99 at gmail dot com
Operating system: Fedora 27
PHP version: 7.3.1
Package: Scripting Engine problem
Bug Type: Feature/Change Request
Bug description:Some fatal errors should be
CompileErrors
Description:
------------
The test script below reads a line of PHP code, evaluates it, and
prints its return value or catches and prints any exception that may
be thrown. However, if the user of the script enters a line like:
function ($x = time()) {}
or
time() = 1
a fatal error is triggered and the script ends.
Those errors should be CompileErrors instead of fatal errors. That
would make it possible for the script to catch those errors, print
them and continue running.
In Zend/zend_compile.c there are other instances of similar errors
(fatal errors that should be CompileErrors).
Test script:
---------------
while (($line = readline("> ")) !== FALSE) {
try {
var_export(eval("return $line;"));
} catch (Throwable $exception) {
echo $exception;
}
echo "\n";
}
--
Edit bug report at https://bugs.php.net/bug.php?id=77525&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77525&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77525&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77525&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77525&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77525&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77525&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77525&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77525&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77525&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77525&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77525&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77525&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77525&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77525&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77525&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77525&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77525&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77525&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77525&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77525&r=mysqlcfg