note 58768 added to function.define

From: Date: Tue, 15 Nov 2005 14:42:32 +0000
Subject: note 58768 added to function.define
Groups: php.notes 
Request: Send a blank email to php-notes+get-98600@lists.php.net to get a copy of this message
Just a quick note.. If a constant is once defined, any subsequent attempts to define it once again are ignored. <? define('WHAT_DID_YOU_EXPECT', 'First'); define('WHAT_DID_YOU_EXPECT', 'Second'); echo WHAT_DID_YOU_EXPECT ?> Outputs 'First'. I really thought I have gone mad when I saw just the last two lines of code (the first one was in another file) and it was echoing 'First'.. ---- Manual Page -- http://www.php.net/manual/en/function.define.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58768 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58768&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58768&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58768&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58768&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58768&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58768&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58768&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58768&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#98600) next »