note 123369 added to control-structures.if

From: Date: Mon, 26 Nov 2018 09:15:27 +0000
Subject: note 123369 added to control-structures.if
Groups: php.notes 
Request: Send a blank email to php-notes+get-209777@lists.php.net to get a copy of this message
It can be tricky to know what commands are executed if these expressions are stacked, here is an overview, general rule is that only the first statement following a true conditional will be executed. php > if (true) if (true) if (true) echo "1 "; echo "2 "; echo "3 "; echo "4 "; 1 2 3 4 php > if (true) if (true) if (false) echo "1 "; echo "2 "; echo "3 "; echo "4 "; 2 3 4 php > if (true) if (false) if (false) echo "1 "; echo "2 "; echo "3 "; echo "4 "; 2 3 4 if (false) if (false) if (false) echo "1 "; echo "2 "; echo "3 "; echo "4 "; 2 3 4 ---- Server IP: 208.43.231.9 Probable Submitter: 46.17.190.238 ---- Manual Page -- http://php.net/manual/en/control-structures.if.php Edit -- https://master.php.net/note/edit/123369 Del: integrated -- https://master.php.net/note/delete/123369/integrated Del: useless -- https://master.php.net/note/delete/123369/useless Del: bad code -- https://master.php.net/note/delete/123369/bad+code Del: spam -- https://master.php.net/note/delete/123369/spam Del: non-english -- https://master.php.net/note/delete/123369/non-english Del: in docs -- https://master.php.net/note/delete/123369/in+docs Del: other reasons-- https://master.php.net/note/delete/123369 Reject -- https://master.php.net/note/reject/123369 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209777) next »