|
Posted by Rik on 12/20/06 08:10
Toby Inkster wrote:
> Rik wrote:
>
>> Not possible in heredoc:
>> - functions/results
>> - constants
>>
>> The last is a great irritation.
>
> <?php
> foreach (get_defined_constants() as $k => $v)
> $CONSTANTS[$k] = $v;
>
> print "E_USER_ERROR is {$CONSTANTS['E_USER_ERROR']}.";
Well, yeah.
The reason for using constants imho is their deployability in functions,
and the fact they never change.
$CONSTANTS will not be a superglobal, so in every function where they have
to be used in such a syntax this would be deployed, or one has to make it
global/use $GLOBALS. Not really a solution, just another workaround. I'd
like to see "{E_USER_ERROR}" work. For now, it's usually either
concatenating small strings or temporarily assign it to a variable, elas.
--
Rik Wasmus
[Back to original message]
|