note 69178 added to function.define
| From: | php-general at lists dot php dot net | Date: | Fri, 25 Aug 2006 14:49:53 +0000 |
| Subject: | note 69178 added to function.define | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116324@lists.php.net to get a copy of this message | ||
Reply to thomas at tgohome dot com:
You could probably achieve the same result using:
array_walk($defines,'define');
The only concern I see with this method is the case where you try to redefine a constant
Example:
<?php
$defines = array(
'CONSTANT' => 'value 1',
'SOME' => 'test',
'CONSTANT' => 'some other value here'
);
array_walk($defines,'define');
?>
I'm not sure what will happen (does PHP give any warnings?)
----
Server IP: 66.163.161.117
Probable Submitter: 89.159.49.177
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.define.php
Edit -- https://master.php.net/note/edit/69178
Del: integrated -- https://master.php.net/note/delete/69178/integrated
Del: useless -- https://master.php.net/note/delete/69178/useless
Del: bad code -- https://master.php.net/note/delete/69178/bad+code
Del: spam -- https://master.php.net/note/delete/69178/spam
Del: non-english -- https://master.php.net/note/delete/69178/non-english
Del: in docs -- https://master.php.net/note/delete/69178/in+docs
Del: other reasons-- https://master.php.net/note/delete/69178
Reject -- https://master.php.net/note/reject/69178
Search -- https://master.php.net/manage/user-notes.php