Re: [PHP4BETA] how to return an error from an internal-function
| From: | Andi Gutmans | Date: | Mon, 20 Sep 1999 14:43:32 +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-4676@lists.php.net to get a copy of this message | ||
Personally, I'd use RETURN_FALSE as it gives us some kind of abstraction.
Andi
At 01:28 PM 9/20/99 +0200, Zeev Suraski wrote:
On Mon, 20 Sep 1999, Thies C. Arntzen wrote: hi i've noticed basic_functions.c3169--- Andi Gutmans <andi@zend.com> http://www.zend.com/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 -- PHP 4 Beta