note 78589 deleted from language.oop5.decon by tularis

From: Date: Thu, 18 Oct 2007 14:18:18 +0000
Subject: note 78589 deleted from language.oop5.decon by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-131499@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- Typer85 at gmail dot com, your assumption proves wrong by a simple modification of prieler at abm dot at's example: <?php class destruction { var $name; function destruction($name) { $this->name = $name; register_shutdown_function(array(&$this, "shutdown")); } function shutdown() { echo 'shutdown: '.$this->name."\n"; } function __destruct() { echo 'destruct: '.$this->name."\n"; } } $a = new destruction('a: global 1'); function test() { $b = new destruction('b: func 1'); $c = new destruction('c: func 2'); } $d = new destruction('d: global 2'); unset($d); test(); echo "End of script\n"; ?> outputs End of script shutdown: a: global 1 shutdown: d: global 2 shutdown: b: func 1 shutdown: c: func 2 destruct: d: global 2 destruct: b: func 1 destruct: c: func 2 destruct: a: global 1 If your assumption was right, the lines "shutdown: d" and "destruct:d" were before the end-of-script line.

« previous php.notes (#131499) next »