Create a reference to a variable with the name of the constant's value. : Variable Reference « Language Basics « PHP






Create a reference to a variable with the name of the constant's value.

 
<?php 
define('CONST_A', 'test'); 

${CONST_A} = 27; 
echo "\$test = $test\n"; 
?>
  
  








Related examples in the same category

1.$b is assigned a copy of $a, and in the second part, $b is assigned a reference to $a.
2.& operator creates a reference
3.Passing by Reference in PHP
4.Only named variables may be assigned by reference.
5.Passing arrays by reference