note 86911 added to control-structures.switch

From: Date: Mon, 10 Nov 2008 09:32:14 +0000
Subject: note 86911 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-146345@lists.php.net to get a copy of this message
Just a word of warning about using switch don't try and compare variables that contain numbers with strings like so: $i=0; switch($i) { case 'TEST': print "Test";break; case 0: print "0";break; } The output will be: Test and not 0. ---- Server IP: 69.147.83.197 Probable Submitter: 196.25.87.66 ---- Manual Page -- http://www.php.net/manual/en/control-structures.switch.php Edit -- https://master.php.net/note/edit/86911 Del: integrated -- https://master.php.net/note/delete/86911/integrated Del: useless -- https://master.php.net/note/delete/86911/useless Del: bad code -- https://master.php.net/note/delete/86911/bad+code Del: spam -- https://master.php.net/note/delete/86911/spam Del: non-english -- https://master.php.net/note/delete/86911/non-english Del: in docs -- https://master.php.net/note/delete/86911/in+docs Del: other reasons-- https://master.php.net/note/delete/86911 Reject -- https://master.php.net/note/reject/86911 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146345) next »