note 24514 added to function.register-shutdown-function
| From: | adam at saki dot com dot au | Date: | Tue, 20 Aug 2002 07:38:56 +0000 |
| Subject: | note 24514 added to function.register-shutdown-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35235@lists.php.net to get a copy of this message | ||
When using objects the syntax register_shutdown_function(array($object, 'function')) will
take a copy of the object at the time of the call. This means you cannot do this in the constructor
and have it correctly destruct objects. The alternative is to use
register_shutdown_function(array(&$object, 'function')) where the ampersand passes the
reference and not the copy. This appears to work fine.
--
http://www.php.net/manual/en/function.register-shutdown-function.php
http://master.php.net/manage/user-notes.php?action=edit+24514
http://master.php.net/manage/user-notes.php?action=delete+24514
http://master.php.net/manage/user-notes.php?action=reject+24514