-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Sam, Jochem,

Sam Barrow wrote:
> I think we should stick with E_WARNING for now. If you want to use
> exceptions you can throw one in a custom error handler. I can change
> about 4 lines of code in my patch to have it emit an E_WARNING easily.
> 
> On Thu, 2008-01-03 at 19:49 +0100, Jochem Maas wrote:
>> am I the only one to consider E_FATAL (as generated for class typehints) 
>> makes
>> type hinting useless -

I'm currently going down exactly this road. Simplified:

set_error_handler('throwit');
function throwit($code, $msg, $file, $line) {
  if (0 == error_reporting()) {
    return;
  }
  throw new Exception("$msg in $file on $line", $code);
}

Of course, Jochem, you're right. Exceptions would be nice.
WrongArgumentException, InvalidWhateverException, ...

- - Markus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHfVWT1nS0RcInK9ARApW9AJ9OF+IM/bKWP5D21TDd6r8tTFhNEACgl9Ok
rS+MNouW6p/4C4iKOW3/AlU=
=887G
-----END PGP SIGNATURE-----

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to