2012/3/8 John Crenshaw <johncrens...@priacta.com>:
>
> Conversion the other way is essential. Consider the following URL:
>
> http://example.com?foo=1
>
> In your PHP script $_GET['foo'] === '1' (a string).
>
> In fact, nearly every input to PHP is a string. This is why PHP was designed 
> with some seriously robust type juggling on scalars. Any typing proposal that 
> wants to actually pass a vote is going to have to allow appropriate implicit 
> conversions from string to other types.
>
> John Crenshaw
> Priacta, Inc.

Hi, John

Ok .. the example with the get-parameter is quite good.
You'll often have the case that you submit a string "0" or "1" and
want to have it as boolean (f.e. if you have a dropdown with two
options).
Please keep in mind not to mix it up with checkboxes as unchecked
checkboxes won't be sent back to your webserver :)

Bye
Simon

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

Reply via email to