On 6/4/2016 4:34 PM, Dan Ackroyd wrote: > 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 >
Hi Dan, many thanks for your feedback. This is definitely NOT the purpose of the extended mode, and I tried to emphasize this in the RFC. I also think it would be very bad to introduce anything that would compete with any of the existing is_* functions. It is also the reason why the strings are very verbose and human readable: they are meant for debug and error messages. // complicated code ... // error branch {{{ $type = typeof($v, true); throw new Ex('Expected Foo but got ' . $type); // }}} // complicated code ... This matches the main usage -- according to my research -- of the existing gettype() function in userland software. :) -- Richard "Fleshgrinder" Fussenegger
signature.asc
Description: OpenPGP digital signature