note 39369 added to control-structures

From: Date: Mon, 26 Jan 2004 08:54:55 +0000
Subject: note 39369 added to control-structures
Groups: php.notes 
Request: Send a blank email to php-notes+get-64194@lists.php.net to get a copy of this message
Hi, running php 4.3.4 and perhaps discovered something (hopefully not my stupidity ;)) why is that this works... if (($addbtn = isset($flds[$i]["addbtn"]))) { if ($addbtn) { // some action } } but this does not.... if (($addbtn = isset($flds[$i]["addbtn"])) || ($editbtn = isset($flds[$i]["editbtn"]))) { if ($addbtn) { // actions here a processed correctly } if ($editbtn) { // actions here are ignored, although, if evaluteing the above // editbtn condition separetly its true so this here should also // be processed } } QUESTION: why ist the second expression after the || (or) not evalueted? ---- Manual Page -- http://www.php.net/manual/en/control-structures.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39369 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39369&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39369&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#64194) next »