Re: invalid params return value
| From: | Stanislav Malyshev | Date: | Fri, 01 Jan 2010 02:35:40 +0000 |
| Subject: | Re: invalid params return value | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46591@lists.php.net to get a copy of this message | ||
Hi!
This is also the documented as the general convention: http://de.php.net/manual/en/functions.internal.php While there are exceptions to this on purpose: For instance get_object is documented to "Return FALSE if /object/ is not an object" (this exception was discussed in detail in the past)I would argue for is_object getting argument which is not an object is not an args parsing error (since this function is supposed to accept args of all types). Getting no argument, on the other hand, is. Though is_object would return false in both cases. But is_numeric(), for example, would produce null when called with no arguments. It's a real mess there. Thanks however for bringing up that manual part - I didn't know it's there. That makes me think case for NULL is much stronger. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com