note 69178 deleted from function.define by bjori
| From: | bjori@php.net | Date: | Sat, 26 Aug 2006 11:20:45 +0000 |
| Subject: | note 69178 deleted from function.define by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-116346@lists.php.net to get a copy of this message | ||
Note Submitter:
Reason: bad code
----
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?)