note 103810 deleted from function.define by danbrown
| From: | danbrown@php.net | Date: | Wed, 04 May 2011 18:55:56 +0000 |
| Subject: | note 103810 deleted from function.define by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179429@lists.php.net to get a copy of this message | ||
Note Submitter: bdavis at cove-mtn dot com
----
>>Something I found out the "hard" way today: integers starting with 0 won't
>>work.
Integers starting with a 0 are octal and do work. The example included 9s and so failed parsing.
>>Constant name must not written as string. The following code works also:
Constant names not written as strings will produce warnings in your error log because evaluating a
constant to get a name is legal.
<?php
define("FOO", "bar");
define("SC", 0777);
define(FOO, 1232); // this is the same as define("bar", 1232);
var_dump(SC); // prints 511
var_dump(bar); // prints 1232
?>