is it possible to display constants php's EOT? for example:
<?
define('Hey', "HellO");
echo
<<<EOT
Hey
EOT;
?>
is it possible to display constants php's EOT? for example:
<?
define('Hey', "HellO");
echo
<<<EOT
Hey
EOT;
?>
Nope. Just like you can't display a constant inside of a string. There are only two real ways to access a constant's value:
Directly in code:
$foo = Hey;
Or using the constant
function:
$foo = constant('Hey');
No, the heredoc syntax (<<<) acts just like a double quoted string in PHP. It will expand variables, but not constants.
You can see a comment in the PHP documentation indicating this here. There is also an editors note on the comment saying that it is correct.