note 93109 deleted from control-structures.if by mkoppanen

From: Date: Sat, 28 Nov 2009 10:46:06 +0000
Subject: note 93109 deleted from control-structures.if by mkoppanen
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-163359@lists.php.net to get a copy of this message
Note Submitter: php dot net at bgr8 dot com Reason: 2 ---- an interesting concept, using only double == ... but i'm executing php from the command line on an ubuntu server using php5 ... and if i use ==, the function fails, but if i use = the function works. i try it with good and bad value pairs echoing "match" to the screen when they match (the executed line) and "match" will not happen with ==. only with =. neither one tosses an error, but the == NEVER shows a match and the = matches when the two strings being compared actually match. this is not something i was expecting after programming in several languages. go figure. #!/usr/bin/php <?php if ($check = $output) echo "match\n"; ?> obviously there's code to make them match or not match, but that code does not change. i JUST add/remove an = and the code works with =.

« previous php.notes (#163359) next »