note 40787 deleted from control-structures by didou

From: Date: Mon, 15 Mar 2004 07:21:23 +0000
Subject: note 40787 deleted from control-structures by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-66850@lists.php.net to get a copy of this message
Note Submitter: php at cybercow se ---- Just to add to what freshprincecharming discovered. When you do a comparsion between 0 and '1asdf' you get true, but not when comparing 0 and 'asdf'.. A little example down. function writeCompare($value1, $value2) { echo('<br> Type:'.(gettype($value1).' == '.gettype($value2 ))); echo(' ('.($value1.' == '.$value2).') ANSWER '.($value1 == $value2)); } echo('<pre>'); writeCompare(0, 'asdf'); // (0 == asdf) ANSWER 1 writeCompare(0, '1adf'); // (0 == 1adf) ANSWER writeCompare(1, 'asdf'); // (1 == asdf) ANSWER writeCompare(1, '1adf'); // (1 == 1adf) ANSWER 1 echo('</pre>');

« previous php.notes (#66850) next »