Re: [RFC DISCUSSION] typeof
| From: | Dan Ackroyd | Date: | Sat, 04 Jun 2016 14:34:30 +0000 |
| Subject: | Re: [RFC DISCUSSION] typeof | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93766@lists.php.net to get a copy of this message | ||
On 4 June 2016 at 13:12, Fleshgrinder <php@fleshgrinder.com> wrote:
> Hi all!
>
> I prepared my first contribution to internals:
>
> https://github.com/php/php-src/pull/1932
>
Hello FG,
Having a standard way to get the type of a variable, that matches the
name of how it appears in PHP is a good idea.
The 'extended' parameter is not such a good idea, for various reasons
but mainly because it's simpler for people to call is_callable() as
well as typeof, rather than having to interpret the extended string to
tell if a string represents a callable.
The same is true for floats; it is easier for people to call
is_infinite or is_nan rather than searching inside a string for
'infinite' or 'invalid'.
cheers
Dan