|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-04-15 08:16 UTC] nikic@php.net
-Assigned To:
+Assigned To: nikic
[2019-04-15 08:24 UTC] nikic@php.net
[2019-04-15 08:24 UTC] nikic@php.net
-Status: Assigned
+Status: Closed
[2019-04-15 08:25 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 14:00:01 2025 UTC |
Description: ------------ If we throw exception from constructor and create object by "new" - destructor never called. But if we create object by ReflectionClass - destructor always by called. Test script: --------------- <?php class Test { public function __construct() { throw new Exception(); } public function __destruct() { echo '__destruct'; } } try { new Test(); } catch(Exception $e) { } echo '--'; try { $ref = new ReflectionClass('Test'); $obj = $ref->newInstance(); } catch(Exception $e) { } Expected result: ---------------- -- Actual result: -------------- --__destruct