|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-18 19:27 UTC] sniper@php.net
[2005-03-25 01:48 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 07:00:01 2025 UTC |
Description: ------------ The bug appears if I'm using any method calls with & (and only with &, I read the other bug reports !!!!!!) to assign the result to a variable within the constructor. if an Exception is thrown after that within the constructor, the destructor is called, although no object was instantiated. Reproduce code: --------------- <?php class test1 { private $test; function __construct() { $this->test =& test1::staticMethod(); throw new Exception(); } static function staticMethod() { return true; } function __destruct() { print 'DESTRUCTOR'; } } $test = new test1(); ?> Expected result: ---------------- I Expected to see no output of my little listing itself, only the error messages. Actual result: -------------- After the exception was printed out in the output, DESTRUCTOR appeared.