note 36043 added to function.trigger-error
| From: | robert at rn2 dot php dot net | Date: | Tue, 23 Sep 2003 21:12:58 +0000 |
| Subject: | note 36043 added to function.trigger-error | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-56993@lists.php.net to get a copy of this message | ||
This one took me some time ...
When you use trigger_error with your own error handler, the class instances are destroyed
(don't know how to say it better, I am not an expert).
So, if you try to call a class function from within the error handler function, you will get
'Call to a member function on a non-object' error, even if this function works perfectly
in the rest of your script.
Solution : re-use the xxx = new yyy to re-create the instance in the beginning of your error handler
... and then you can call the class functions you want !
----
Manual Page -- http://www.php.net/manual/en/function.trigger-error.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36043
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36043&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36043&report=yes