Re: Callable typehint
| From: | Chris Stockton | Date: | Mon, 06 Jun 2011 23:20:23 +0000 |
| Subject: | Re: Callable typehint | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53109@lists.php.net to get a copy of this message | ||
Hi Stas,
On Mon, Jun 6, 2011 at 4:02 PM, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
>
> I wouldn't love it a bit, frankly, as "rely on PHP's native error handling"
> in this context means "bombing out in runtime without any idea what went
> wrong". When you have exception, you could make it print what happened and
> recover, if you want. When you have fatal error, you can't do much at all.
The patch as you probably know throws a E_RECOVERABLE_ERROR, which in
my humble opinion doesn't quite fall under the end-of-world category
you seem to explain there :- )
I.E.
function bar($a, $b, $c, $d)
{ return true; }
set_error_handler("bar");
class Foo
{
public function test(Array $arr) {}
}
$foo = new Foo; $foo->test('invalid');
echo "Everything will be okay.. :p";
-Chris