I just started using this heredoc syntax after reading about it. Pretty handy and easy to use.
One thing I dont understand though.
The following will fail:
With aCode:$ret_val = <<<EOT $_SESSION['usr_sal']; EOT;error.Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
However, this will work fine:
I dont get it...both are essentially the same thing, or not?Code:$var = $_SESSION['usr_sal']; $ret_val = <<<EOT $var EOT;
The same thing goes for constants I defined in included files.




Reply With Quote