Re: Legal variable names

[email protected] (André Langhorst)
Newsgroups php.lang
Organization php-qat - http://qa.php.net
Message-ID <[email protected]>
> That's what I was asking. I just am rather careful there because somebody
> wrote that code so he should have meant something by it - maybe there are
> reasons I'm not aware of.

well as discussed before this code is an relict from register_globals=on

>     With regard to php-lang, are there any opinions on whether
>     a construct like this should be legal?
> 
>         '${' expression '}'
> 
>     where expression evaluates to an arbitrary string, not
>     necessarily to an identifier (which is basically
>     [a-z][a-z0-9]*).

why not? you can even use ä,ü,ö without using ${' äöü '}, should these 
be legal - let the user decide how to write his code

I'm not sure if I already said, using variables varialbles this might be 
helpful

$a=array('foobar 1','foobar 2','foobar 3','foobar1',' foobar 1');
foreach($a AS $val)   {
    $$val=somestuff(); }

this is fairly legal right now and of course this should be legal to be 
able to access them manually

echo ${'foobar 1'};


if wisely used an interesting feature

andré


-- 
· André Langhorst       · t: +49 571 3201801 ·
· [email protected]   · m: +49 173 9558736 ·
· PHP Quality Assurance · http://qa.php.net  ·
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.