Re: Mixed return type - boolean and array/resource/closure or object
| From: | Sebastian Krebs | Date: | Wed, 05 Mar 2014 02:17:33 +0000 |
| Subject: | Re: Mixed return type - boolean and array/resource/closure or object | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323031@lists.php.net to get a copy of this message | ||
2014-03-04 0:10 GMT+01:00 Robert Stoll <php@tutteli.ch>:
> Heya,
>
> I would like to know if a PHP built-in function/method exists which
> returns one of the following combinations
> - a boolean or an array
> - a boolean or a resource
> - a boolean or a closure
> - a boolean or an object
>
> I searched in the language manual, but it is quite hard to be honest since
> there is not really an overview.
> Please get back to me if you are certain that there is not such a
> function/method or give me an example if there is one.
>
Some array functions like "current", "array_pop" and so on (item of
arbitrary type or null) can return everything. An example for "boolean or
object" is 'date_create' [1]. Afaik there is no built-in function, that
returns a closure, so the combination "boolean or closure" is not possible
at all.
[1] http://php.net/datetime.construct
>
> Cheers,
> Robert
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
github.com/KingCrunch