Bug #73163 [Asn->Csd]: PHP hangs if error handler throws while accessing undef const in default value

From: Date: Sat, 24 Sep 2016 11:24:25 +0000
Subject: Bug #73163 [Asn->Csd]: PHP hangs if error handler throws while accessing undef const in default value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204238@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73163&edit=1 ID: 73163 Updated by: nikic@php.net Reported by: nikic@php.net Summary: PHP hangs if error handler throws while accessing undef const in default value -Status: Assigned +Status: Closed Type: Bug Package: Scripting Engine problem PHP Version: 7.0.11 Assigned To: nikic Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikic Revision: http://git.php.net/?p=php-src.git;a=commit;h=8831a12da1671bcfca8607d5af505d69ba938917 Log: Fixed bug #73163 Previous Comments: ------------------------------------------------------------------------ [2016-09-24 10:59:22] nikic@php.net 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 this bug report at https://bugs.php.net/bug.php?id=73163&edit=1

« previous php.bugs (#204238) next »