Hi, What should happen when you run the following script? <? $how_bogus = false; if($how_bogus == ""){ echo "How bogus IS NOT FALSE, or php doesn't know what false means\n"; }
?>
My 8 year old nephew can tell you what true and false means.
Sick and Tired of PHP
Maybe you should get your 8-year-old nephew to teach you then. He could read to you from the manual.
http://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting
Methinks your 8 yr old nephew would get sick of trying to teach you the difference
Common Sense........... hhhmmm goes a long way.
That's NOT how it's done in other languages .... of course they are based a little more on common sense
Well, then vmusic, why not try:
<?php $how_bogus = false; if ($how_bogus === "") { echo "How bogus IS NOT FALSE, or php doesn't know what false means\n"; } else { echo "See? PHP does know what false strictly means!\n"; } ?>
Originally posted by LordShryku Methinks your 8 yr old nephew would get sick of trying to teach you the difference
methinks i am in agreeance!
Originally posted by vmusic Common Sense........... hhhmmm goes a long way. That's NOT how it's done in other languages .... of course they are based a little more on common sense
Um...
<script type="text/javascript"> how_bogus = false; if(how_bogus == ""){ alert("How bogus IS NOT FALSE, or Javascript doesn't know what false means\n"); } </script>
PHP is a loosely-typed language with implicit casting. If you don't know what that means, go out and find yourself an 8-year-old to ask.
An empty string is NOT false, false is bolean. If you want to check it with the bolean false try:
$how_bogus = false; if(!$how_bogus){ echo "how_bogus IS false!\n"; } else { echo "how_bogus is anything BUT false.\n"; }
vmusic if your sick and tired of php why are you still doing it?
What has been said is true. Not ever language is the same, just because PHP is different to one doesnt mean PHP sucks. It what makes it unique