Bug #73163 [NEW]: PHP hangs if error handler throws while accessing undef const in default value

From: Date: Sat, 24 Sep 2016 10:59:23 +0000
Subject: Bug #73163 [NEW]: PHP hangs if error handler throws while accessing undef const in default value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204237@lists.php.net to get a copy of this message
From: nikic Operating system: PHP version: 7.0.11 Package: Scripting Engine problem Bug Type: Bug Bug description:PHP hangs if error handler throws while accessing undef const in default value Description: ------------ If an undefined unqualified constant is used in a parameter default value and a registered error handler converts the "undefined constant" notice into an exception PHP will hang. This only happens if global registers are used. Test script: --------------- <?php error_reporting(E_ALL); function doSomething(string $value = UNDEFINED_XYZ) { } set_error_handler(function() { throw new Exception; }); doSomething(); Expected result: ---------------- Exception is thrown Actual result: -------------- PHP enters an infinite loop -- Edit bug report at https://bugs.php.net/bug.php?id=73163&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73163&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73163&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73163&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73163&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73163&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73163&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73163&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73163&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73163&r=support Expected behavior: https://bugs.php.net/fix.php?id=73163&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73163&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73163&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73163&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73163&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73163&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73163&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73163&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73163&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73163&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73163&r=mysqlcfg

« previous php.bugs (#204237) next »