note 81282 added to function.get-defined-constants

From: Date: Thu, 21 Feb 2008 03:42:17 +0000
Subject: note 81282 added to function.get-defined-constants
Groups: php.notes 
Request: Send a blank email to php-notes+get-136336@lists.php.net to get a copy of this message
I'm not so sure eslindsey AT gma il dot co m is correct. From my experience, using constance in an array works fine if you think about it as a math constant. Take the example below, it works on 4.x and 5.x <? //Our define, probably located in a config file somewhere define('SomeName', 3); //The call to our function test(); //The function itself function test() { $test = array('10', '13', 'whatever', 'somethingelse', '85'); echo $hithere = $test[(SomeName)]; echo "\n"; echo "\n"; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 71.208.229.134 ---- Manual Page -- http://www.php.net/manual/en/function.get-defined-constants.php Edit -- https://master.php.net/note/edit/81282 Del: integrated -- https://master.php.net/note/delete/81282/integrated Del: useless -- https://master.php.net/note/delete/81282/useless Del: bad code -- https://master.php.net/note/delete/81282/bad+code Del: spam -- https://master.php.net/note/delete/81282/spam Del: non-english -- https://master.php.net/note/delete/81282/non-english Del: in docs -- https://master.php.net/note/delete/81282/in+docs Del: other reasons-- https://master.php.net/note/delete/81282 Reject -- https://master.php.net/note/reject/81282 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#136336) next »