Re: [PHP4BETA] how to return an error from an internal-function
| From: | Zeev Suraski | Date: | Mon, 20 Sep 1999 11:28:40 +0000 |
| Subject: | Re: [PHP4BETA] how to return an error from an internal-function | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4657@lists.php.net to get a copy of this message | ||
On Mon, 20 Sep 1999, Thies C. Arntzen wrote:
> hi i've noticed
>
> basic_functions.c3169
>
> if (input->type != IS_ARRAY) {
> zend_error(E_WARNING, "First argument to array_keys() should be an array");
> return;
> }
>
> shouldn't that read:
>
> if (input->type != IS_ARRAY) {
> zend_error(E_WARNING, "First argument to array_keys() should be an array");
> RETURN_FALSE; /* or similar */
> }
>
> i know empty_string evaluates to false - but this is just a question of style -
It's indeed a question of style. The default return value of a function
is false, and is something you can rely on.
Zeev
--
-----------------------------------------------------
Zeev Suraski <zeev@zend.com> http://www.zend.com/
For a PGP public key, finger bourbon@netvision.net.il