|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-04-09 11:00 UTC] laruence@php.net
-Assigned To:
+Assigned To: laruence
[2014-04-09 11:00 UTC] laruence@php.net
[2015-08-14 17:56 UTC] cmb@php.net
-Status: Assigned
+Status: Closed
[2015-08-14 17:56 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 30 04:00:01 2025 UTC |
Description: ------------ The following code behaves unexpectedly with finally, see the reproduce code. Test script: --------------- First file: <?php spl_autoload_register(function(){ require_once "test1.php"; }); try { try { throw new \RuntimeException("ERROR"); } finally { echo "AUTOLOAD", PHP_EOL; $q = \Test::ONE; echo "YOU WON'T SEE THIS LINE", PHP_EOL; } } catch (\Exception $Error) { echo $Error->getMessage(), PHP_EOL; } ?> Second file: test1.php <?php class Test { const ONE = "ONE"; } echo \Test::ONE, PHP_EOL; Expected result: ---------------- The code in finally() is executed only partly: the lines after the autoload are ignored. I would expect the result look like this: AUTOLOAD ONE YOU WON'T SEE THIS LINE ERROR Actual result: -------------- AUTOLOAD ONE ERROR