Re: Exceptions instead of Fatal Error when calling non existent method?
| From: | Derick Rethans | Date: | Thu, 03 Jan 2008 08:54:11 +0000 |
| Subject: | Re: Exceptions instead of Fatal Error when calling non existent method? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34322@lists.php.net to get a copy of this message | ||
On Mon, 31 Dec 2007, Fredrik Holmström wrote:
> What I would like to argue/request is that there should be a way to
> get an exception thrown when you call a non existent method on an
> object, since it's not possible to catch E_ERROR with a user defined
> function using set_error_handler() I can't see anyway to accomplish
> this in the current implementation?
E_ERROR should during normal runs of your program *never* be hit in the
first place. If it is something critical that still can be handled,
E_RECOVERABLE_ERROR should be used inside PHP. If that is not the case,
please let us now and we can address that.
As for the calling undefined methods, __call() is your friend.
regards,
Derick