note 104646 deleted from function.define by danbrown
| From: | danbrown@php.net | Date: | Tue, 28 Jun 2011 19:22:19 +0000 |
| Subject: | note 104646 deleted from function.define by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-181019@lists.php.net to get a copy of this message | ||
Note Submitter: rmasta at gmail dot com
----
In response to andreas
Your example
define(MY_NAME, 'value');
works like this in PHP:
PHP tries to find constant, and if such constant does not exist, it interprets it as a string. If
such constant did exist, it would generate an error.
Also, using MY_NAME for string 'MY_NAME' generates a warning. Enable all warnings and You
should see it.
So in general, it is best just to stick to writing strings as strings :)