Re: RFC: Catchable "call to a member function of a non-object"
| From: | Levi Morrison | Date: | Sun, 27 Apr 2014 18:48:38 +0000 |
| Subject: | Re: RFC: Catchable "call to a member function of a non-object" | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-73816@lists.php.net to get a copy of this message | ||
The example from the Introduction looks like this:
// ...when getAction()returns null:
$this->getAction()->invoke();
My first thought is that if getAction is declared with a return type as per
the currently under discussion return type RFC, then when a null is
returned you'd get an E_RECOVERABLE error there already. I realize there
are other cases and motivations for this RFC, but this is one motivating
case for the return type RFC in the first place.