note 34516 added to function.register-shutdown-function
| From: | Mocha at rack1 dot php dot net | Date: | Tue, 29 Jul 2003 22:04:05 +0000 |
| Subject: | note 34516 added to function.register-shutdown-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52965@lists.php.net to get a copy of this message | ||
Using the snip:
---
class Object {
var $somevar = "foo";
function Object() {
$somevar = "bar";
register_shutdown_function(array(&$this, 'MyDestructor'));
}
function MyDestructor() {
# Do useful destructor stuff here...
}
}
# Now create the object as follows and then 'MyDestructor'
# will be called on shutdown and will be able to operate on
# the object as it ended up... not as it started!
$my_object =& new Object;
---
Gives me this error:
---
Warning: Unknown(): Unable to call Array() - function does not exist in Unknown on line 0
---
Tested on PHP-4.3.2
----
Manual Page -- http://www.php.net/manual/en/function.register-shutdown-function.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34516
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34516&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34516&report=yes