From:             tom at minnesota dot com
Operating system: NetBSD/Alpha (64bit) - 1.6
PHP version:      4.3.2
PHP Bug Type:     Scripting Engine problem
Bug description:  register_shutdown_function param doesn't take array(obj, method)

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 bug report at http://bugs.php.net/?id=24860&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24860&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24860&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24860&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24860&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24860&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24860&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24860&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24860&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24860&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24860&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24860&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24860&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24860&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24860&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24860&r=gnused

Reply via email to