On Thu, Jan 15, 2015 at 9:29 AM, Lester Caine <les...@lsces.co.uk> wrote:
>
> One of the nice features of PHP when I started using it all those years
> ago was that I did not have to create separate functions different types
> did exist in the source data. int/float/num/double and others all needed
> separate handling in c/c++, and one could not easily add a different
> 'type' of data.
>

If you have a function which requires a "double" in C# (a strongly
typed language), you can safely pass int to the function and it will
work, because you are not narrowing the possible values. So making the
PHP accept only the argument if its type is exactly the same as the
parameter (paraphrased from RFC for the strict version of type hints)
seems like a step in a wrong direction. If I'm not mistaken, Java
behaves the same way. How exactly does it work in C++ and C? I haven't
used C in years, so I'm a little bit rusty on this detail.

Pavel Kouril

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

Reply via email to