Please lets have exceptions here, otherwise you will render type-hints useless (they are intended primarily for OO programmers anyway).
I'm somewhat concerned that we are implementing a lot of the new OO features in a half-hearted fashion; I understand that there is a balance to maintain between easy-accessibility and "enterprise" features.
I think that we're having a very hard time defining this balance.
I've mentioned several times now that unhandled exceptions look just like E_ERRORS to procedural/non-OO programmers; please can we have the new OO-related features throw exceptions rather than trigger E_ERRORS as it allows "real" programmers to write more robust code.
I'm very much against it. I'm extremely worried about the perception of PHP, and losing its perhaps only advantage to other languages, and that's ease of use. Even OO should be as simple as possible unless you start using advanced features.
We should keep this stuff as errors, and not exceptions. I still think we can have a mode where recoverable errors will throw exceptions instead of erroring out, so users will be able to explicitly ask for exceptions if they wish, and won't see exceptions otherwise. Remember that we don't want to encourage exception based programming anyway. Catching an exception should typically be the last thing done in a program, right before it terminates. Writing exception-driven applications is extremely discouraged. So, in the cases we're dealing with, there should be very little reason to catch an exception, rather than just error out with the right error message. For the cases where it does make sense, I think the exceptions-for-errors mode would suffice.
Zeev
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php