note 41232 added to function.set-error-handler
| From: | jayp at groovejob dot com | Date: | Sat, 03 Apr 2004 14:28:05 +0000 |
| Subject: | note 41232 added to function.set-error-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67562@lists.php.net to get a copy of this message | ||
In response to sijmen at digitized dot nl:
Instead of
$eh = new error;
use
$eh =& new error();
The new operator returns a copy of the error object, so the error handler that is set in the
constructor is tied to a different object instance than the instance returned by "new".
To make sure you are working with the exact same object instance that you think you are, it's
best to use the reference object when creating instances of objects, like so:
$oMyObject =& new MyObject();
HTH,
Jay
----
Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41232
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41232&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41232&report=yes
Search -- http://master.php.net/manage/user-notes.php