Re: [Zend Engine 2] Re: [PHP-DEV] Re: Type hints revisited [IllegalArgumentException instead of E_ERROR]
| From: | (Marcus Börger) | Date: | Mon, 31 Mar 2003 18:34:59 +0000 |
| Subject: | Re: [Zend Engine 2] Re: [PHP-DEV] Re: Type hints revisited [IllegalArgumentException instead of E_ERROR] | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-548@lists.php.net to get a copy of this message | ||
At 14:55 31.03.2003, Wez Furlong wrote:
You can use function_exists() to avoid a fatal error, but there is no equivalent function_parameters_are_ok() API to avoid a miserable death in the situations that I have already mentioned. Why not just be consistent with all the other parameter checks and raise an E_WARNING and RETURN_NULL when the parameters are incorrect? I don't see what is so special about hinted parameters that they have to bail out the engine, while the built-in (and extension) functions will happily return NULL and continue execution.We are NOT consistent. Some functions return NULL, some return false and most functions do not even document what they do. And there are functions that return NULL and false depending on the type of error. marcus