Re: Mixed return type - boolean and array/resource/closure or object
| From: | Christoph Becker | Date: | Wed, 05 Mar 2014 16:36:49 +0000 |
| Subject: | Re: Mixed return type - boolean and array/resource/closure or object | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323035@lists.php.net to get a copy of this message | ||
Robert Stoll wrote:
> Nevertheless, the signature in the documentation implies that
> date_create() returns always DateTime. I already submitted a patch to
> change it to mixed :)
IMHO, the signature is fine, as false is returned only in *exceptional*
cases. To be strict, changing the return type to mixed had to be done
for (nearly) *all* functions, because several may return false in error
cases, and many will return null when wrong arguments are passed.
--
Christoph M. Becker