Re: Why no type hints for built-in types?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Terje Slettebø wrote:
I don't find this answer satisfactory. Yes, PHP has loose/weak typing, but
at any one time, a value or a variable has a distinct type. In the example
in the quote above, you'd have to ensure that the value you pass is of the
right type.

Well, like it or not, that is the way it is. PHP is first and foremost a web scripting language. Browsers don't send a type along with each bit of information they send. Everything comes across as a string and as such all the internal PHP functions do the right thing when you pass a string to a function that really takes a number. We have no plans to break this and create an inconsistent set of functions that no longer do this.


-Rasmus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux