note 104366 deleted from function.define by cmb
| From: | cmb@php.net | Date: | Sun, 06 Oct 2019 07:53:13 +0000 |
| Subject: | note 104366 deleted from function.define by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212479@lists.php.net to get a copy of this message | ||
Note Submitter: kobrasrealm at gmail dot com
----
When going back to rewrite code, it might be tempting to have a constant &reference a variable,
but it doesn't work.
<?php
header("Content-type: text/plain");
$variable = "value";
define("MYCONSTANT", &$variable);
echo $variable."\n";
echo MYCONSTANT."\n";
echo "------\n";
$variable = "different";
echo $variable."\n";
echo MYCONSTANT;
?>
Produces this:
value
value
------
different
value
I doubt it's supposed to work, either. :)