|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-16 16:46 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 23:00:01 2025 UTC |
Description: ------------ Only look at the code and the output of it. I think, new objects in variables, which are already existent and contain an old object, should be call the destructor of the old object... im sorry for my english... Reproduce code: --------------- <?php class test { static $i = 0; public function __construct() { self::$i ++; echo "alive: " . self::$i . "<br />"; } public function __destruct() { echo "dead" . self::$i . "<br />"; } } $obj = new test; $obj = new test; ?> Expected result: ---------------- alive: 1 dead1 alive: 2 dead2 Actual result: -------------- alive: 1 alive: 2 dead2 dead2