note 78589 added to language.oop5.decon
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 18 Oct 2007 10:24:25 +0000 |
| Subject: | note 78589 added to language.oop5.decon | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131490@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 217.13.201.10
Probable Submitter: 88.77.8.176
----
Manual Page -- http://www.php.net/manual/en/language.oop5.decon.php
Edit -- https://master.php.net/note/edit/78589
Del: integrated -- https://master.php.net/note/delete/78589/integrated
Del: useless -- https://master.php.net/note/delete/78589/useless
Del: bad code -- https://master.php.net/note/delete/78589/bad+code
Del: spam -- https://master.php.net/note/delete/78589/spam
Del: non-english -- https://master.php.net/note/delete/78589/non-english
Del: in docs -- https://master.php.net/note/delete/78589/in+docs
Del: other reasons-- https://master.php.net/note/delete/78589
Reject -- https://master.php.net/note/reject/78589
Search -- https://master.php.net/manage/user-notes.php