Reply to Re: Getting a function result while in heredoc

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация