ID:               24860
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tom at minnesota dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Scripting Engine problem
 Operating System: NetBSD/Alpha (64bit) - 1.6
 PHP Version:      4.3.2
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Works fine here with the exact code you pasted.  Please try the
snapshot indicated above.


Previous Comments:
------------------------------------------------------------------------

[2003-07-29 17:16:09] tom at minnesota dot com

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.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24860&edit=1

Reply via email to