Bug #80058 [NEW]: Unparenthesized `a ? b : c ? d : e` does not trigger own error handler
| From: | jochem dot blok at fasterforward dot nl | Date: | Fri, 04 Sep 2020 10:34:59 +0000 |
| Subject: | Bug #80058 [NEW]: Unparenthesized `a ? b : c ? d : e` does not trigger own error handler | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-228881@lists.php.net to get a copy of this message | ||
From: jochem dot blok at fasterforward dot nl
Operating system: Ubuntu 20.04
PHP version: 7.4.10
Package: Unknown/Other Function
Bug Type: Bug
Bug description:Unparenthesized
a ? b : c ? d : e does not trigger own error handler
Description:
------------
Error "Unparenthesized a ? b : c ? d : e is deprecated. Use either `(a
? b : c) ? d : e or a ? b : (c ? d : e)`" does not trigger own error
handler. Callingerror_get_last() does return this error.
Test script:
---------------
function shutdown()
{
$error = error_get_last();
var_dump($error);
}
register_shutdown_function('shutdown');
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
echo "\n\n--------------- ERROR ---------------------\n\n";
echo "\n".'errno = '; print_r($errno);
echo "\n".'errstr = '; print_r($errstr);
echo "\n".'errfile = '; print_r($errfile);
echo "\n".'errline = '; print_r($errline);
return true;
}
set_error_handler("myErrorHandler");
$a = 1;
$b = 2;
$c = 3;
$d = 4;
$e = 5;
echo $a ? $b : $c ? $d : $e;
parse_str ('wrweqr');
Expected result:
----------------
As you can see parse_str is handle by the own error handler. "echo $a ?
$b : $c ? $d : $e;" should also be handled.
Actual result:
--------------
Only parse_str is handled.
--
Edit bug report at https://bugs.php.net/bug.php?id=80058&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80058&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80058&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80058&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80058&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80058&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80058&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80058&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80058&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80058&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80058&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80058&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80058&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80058&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80058&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80058&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80058&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80058&r=mysqlcfg