Hi!

yeah, but usually you return null/false in case of error when you write
procedural code.

Nope. I use it all the time when writing OO code and when "nothing" or "no object" or "can't do this" is a valid answer for a function to return.

but since we wouldn't support the return typehint for scalars, maybe we
could assume that the only sane people who would use this feature would
also do the error handling will through Exceptions (@throws :P).

Exceptions are for _exceptional_ situations. If you query a DB for an object and there's no object like this, you don't want an exception if this situation is normal and handled in your code - you want a null or false or something like that. Exception is for situations that you code can not foresee or handle, they are not for regular data flow control.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to