Hi François,

> On 5 Feb 2015, at 08:58, François Laupretre <franc...@tekwire.net> wrote:
> 
> +1. Checking IS_<type> at the C level after implicit conversions and checking 
> this at the PHP level are very different.
> 
> IMHO, the key point is the concept of 'type'. Strict typing considers a 
> one-to-one correspondence between PHP types and zval types, which is 
> nonsense. At the PHP level, any value returning true through is_numeric() IS 
> a 'number', and it must remain so. Any such value with a null decimal part is 
> an 'integer' (not the result of 'is_int()') and so on.

This simply isn’t how PHP works. PHP has a limited form of type juggling, but 
the types of values are not merely an implementation detail. There are numerous 
places where PHP completely violates the notion that these types don’t matter, 
such as comparisons, sorting, functions accepting multiple types, functions 
returning multiple types, bitwise operators and array indexing. All of these 
discriminate between types. To claim that types are merely an aspect of a zval 
is ignorance in the extreme.

--
Andrea Faulds
http://ajf.me/





--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to