note 41232 deleted from function.set-error-handler by cmb
| From: | cmb@php.net | Date: | Sun, 25 Aug 2019 09:01:40 +0000 |
| Subject: | note 41232 deleted from function.set-error-handler by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211991@lists.php.net to get a copy of this message | ||
Note Submitter: jayp at groovejob dot com
----
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