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"; ?>