|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-29 19:40 UTC] pollita@php.net
[2003-07-29 22:39 UTC] tom at minnesota dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 06:00:02 2025 UTC |
Description: ------------ It seems like register_shutdown_function doesn't take a param of array(obj, method): register_shutdown_function(array(&$this, 'MyDestructor')); --- Fails with this error: Warning: Unknown(): Unable to call Array() - function does not exist in Unknown on line 0. Reproduce code: --------------- <?php 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; ?> Expected result: ---------------- Pseudo destructor to perform properly with register_shutdown_function taking an array(obj, method). Actual result: -------------- Warning: Unknown(): Unable to call Array() - function does not exist in Unknown on line 0.