note 36975 added to language.types.type-juggling

From: Date: Wed, 29 Oct 2003 14:24:16 +0000
Subject: note 36975 added to language.types.type-juggling
Groups: php.notes 
Request: Send a blank email to php-notes+get-59472@lists.php.net to get a copy of this message
Just a little something that got me stuck for a amazing 5 minutes.. According to PHP this is the same.. --------------- if("1.15"=="1.150") echo "Look me being buggy!"; --------------- It does output the "Look me being buggy!" code! What happends is that php sees the dot (.) for a number so it typecasts the TEXT to a FLOAT before matching the values. Even still its not the same but it does give the same amount. Anyway, if you use a triple === it doesnt echo anything this is because the value and the TYPE have to be required to give a TRUE back. --------------- if("1.15"==="1.150") echo "Look me being buggy!"; --------------- So this doesn't give anything back .. Another problem solved! ---- Manual Page -- http://www.php.net/manual/en/language.types.type-juggling.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36975 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36975&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36975&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#59472) next »