Re: New destructors implementation
| From: | Red Wingate | Date: | Fri, 06 Feb 2004 02:51:42 +0000 |
| Subject: | Re: New destructors implementation | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7622@lists.php.net to get a copy of this message | ||
Is the removal of a specific order on the __destruct() calls
necessary? It's a pain in the ass the be unable to predict
in which order the __destruct() calls are made.
<?php
class my_error {
private $error_log = array();
function error_Register ( ... ) {
// register error to $this->error_log;
}
function __destruct () {
// Dump Error-Log to User ( E-Mail, HTML etc. )
}
}
class my_class {
// some code here
function __destruct () {
// trigger a error-msg
}
}
$my_error = new my_error();
set_error_handler( array( &$my_error , 'error_Register' ) );
$my_class = new my_class();
?>
In PHP 5 beta 3 even the error's thrown by my_class::__destruct() would
be dumped by my_error::__destruct(), this won't work for the latest Snap.
Red