Re: RFC: Catchable "call to a member function of a non-object"
On Tue, Apr 29, 2014 at 6:50 PM, Marco Pivetta <ocramius@gmail.com> wrote:
> On 29 April 2014 10:26, Derick Rethans <derick@php.net> wrote:
>
> > Programming mistakes should not be hidden by error
> >
>
> Of course, but what about having a PHPUnit tests that hard-fail due to a
> "PHP Fatal error: Call to a member function foo() on a non-object in ..."?
>
> Just being able to have a handler that catches it as an error is pretty ok,
> and it surely allows me to see if there are other failures in a huge test
> suite
> without having to come up with some crazy code just to run the tests one by
> one.
>
It's not unthinkable that such a scenario may occur in a production system,
even if the tests passed; when that happens you would now get a WSOD
instead of being able to log/mail the error and show an appropriate error
page.
> This use case already makes it worth having this improvement in my opinion.
>
> Cheers,
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://ocramius.github.com/
>
--
--
Tjerk
Thread (11 messages)