On Tue, 23 Jan 2001, Cynic wrote:

> seems like 'three'. but someone with more knowledge should 
> answer this.

Since it's actually possible to have a variable named $test[2], that
would probably lead to confusion.

For example,

$var = 'test[2]';
${'test[2]'} = 'Foo';
echo $$var;

Will output 'Foo'.

Matt

> At 16:39 23.1. 2001, Wico de Leeuw wrote the following:
> -------------------------------------------------------------- 
> >So what should it echo?
> >three or Grrr?
> >
> >i think three
> >
> >Greetz,
> >
> >Wico
> >
> >>Previous Comments:
> >>---------------------------------------------------------------------------
> >>
> >>[2001-01-23 10:07:21] [EMAIL PROTECTED]
> >>changed status
> >>
> >>---------------------------------------------------------------------------
> >>
> >>[2001-01-23 10:06:24] [EMAIL PROTECTED]
> >>ok and that isn;t working either...
> >>althoug i liked the first more (and still think it should be that way)
> >>
> >>so this doesn't work either:
> >>
> >>$three = "Grrrr";
> >>
> >>echo "Test";
> >>$test = Array("one","two","three","four"); $var = 'test[2]'; echo $$var; /* should 
>echo "three" */
> >>
> >>
> >>---------------------------------------------------------------------------
> >>
> >>[2001-01-23 09:59:43] [EMAIL PROTECTED]
> >>no. it will echo contents of $three. if you don't have that variable in current 
>scope, it'll echo null, and, depending on your settings, emit a warning.
> >>
> >>---------------------------------------------------------------------------
> >>
> >>[2001-01-23 09:57:18] [EMAIL PROTECTED]
> >>according to Zeev this should work:
> >>
> >>$test = Array("one","two","three","four"); $var = 'test[2]'; echo $$var; /* should 
>echo "three" */
> >>
> >>But with it doesn't
> >>
> >>
> >>Greetz,
> >>
> >>Wico
> >>
> >>---------------------------------------------------------------------------
> >>
> >>
> >>Full Bug description available at: http://bugs.php.net/?id=8860
> >>
> >>
> >>--
> >>PHP Development Mailing List <http://www.php.net/>
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> ------end of quote------ 
> 
> 
> 
> ____________________________________________________________
> Cynic:
> 
> A member of a group of ancient Greek philosophers who taught
> that virtue constitutes happiness and that self control is
> the essential part of virtue.
> 
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to