note 28963 deleted from function.register-shutdown-function by sniper
| From: | sniper@php.net | Date: | Thu, 06 Nov 2003 20:25:21 +0000 |
| Subject: | note 28963 deleted from function.register-shutdown-function by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60022@lists.php.net to get a copy of this message | ||
Note Submitter: kwazy@php.net
----
The previous note refers to this function being broken, that is false. Testing this morning under
both Linux/PHP-4.3.0 and Win2k/PHP-4.3.0 show that both the function registration and the
call-by-reference for an object is working under these platforms without problem.
Tested code:
<?php
class closeme {
var $msg;
function closeme($m) {
$this->msg = $m;
}
function post()
{
$fp = fopen("E:\\Temp\\shutdown.log",'a');
if ($fp) {
fwrite($fp,date('Y-m-d H:i:s').' -- '.$this->msg."\n");
fclose($fp);
}
}
}
$closer = new closeme('This message should work');
register_shutdown_function(array(&$closer,'post'));
echo "Registered and exited...";
?>