On 7/2/2009 13:56, Hannes Magnusson wrote:
<?php
function throw_exception($errno, $errmsg) {
if (strpos($errmsg, "Argument ") === 0) {
throw new InvalidArgumentException($errmsg, $errno);
}
return false;
}
set_error_handler("throw_exception", E_RECOVERABLE_ERROR);
function foo(array $arr) {}
foo("string");
Actually, I'd use an exception class which extends from the builtin
ErrorException
class, but that's not the point. Anyway, probably Kalle Sommer Nielsen
is right,
and the way PHP already behaves in that regard should be kept. At least
for now.
--
Ionut G. Stan
I'm under construction | http://igstan.blogspot.com/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php