note 35729 added to function.define

From: Date: Fri, 12 Sep 2003 12:11:26 +0000
Subject: note 35729 added to function.define
Groups: php.notes 
Request: Send a blank email to php-notes+get-56368@lists.php.net to get a copy of this message
To brentonb and others reading his note: I think this is expected behavior based on the rules of the PHP parser. Bare words are first looked up as constants, then failing that, treated as strings So if POPUP isn't define()'d, the code block if (POPUP) {//do stuff} transforms to if ("POPUP") {//do stuff} and a non-empty string casts to TRUE. ---- Manual Page -- http://www.php.net/manual/en/function.define.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35729 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35729&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35729&report=yes

« previous php.notes (#56368) next »