Variable Variables

Variable Variables

am 06.04.2008 23:16:48 von Animesh Kumar

I came across the interesting notion of $a and $$a, which in turns uses
the string in $a as a $-suffix to make a new dynamic variable.

Can someone illustrate a practical use out of it? I will be very curious
to see one (webdesign related) example of its usage.

Thanks,
Animesh

Re: Variable Variables

am 06.04.2008 23:52:13 von Michael Fesser

..oO(Animesh K)

>I came across the interesting notion of $a and $$a, which in turns uses
>the string in $a as a $-suffix to make a new dynamic variable.
>
>Can someone illustrate a practical use out of it? I will be very curious
>to see one (webdesign related) example of its usage.

There's hardly a reason to use them. Often enough they are misused in
situations where an array would be much more appropriate.

Micha

Re: Variable Variables

am 07.04.2008 03:31:45 von Jerry Stuckle

Animesh K wrote:
> I came across the interesting notion of $a and $$a, which in turns uses
> the string in $a as a $-suffix to make a new dynamic variable.
>
> Can someone illustrate a practical use out of it? I will be very curious
> to see one (webdesign related) example of its usage.
>
> Thanks,
> Animesh
>

I agree with Micha. Variable variables are a solution looking for a
problem. It creates code which is very difficult to manage and update,
and should not be used.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Variable Variables

am 07.04.2008 21:40:27 von Animesh Kumar

Jerry Stuckle wrote:
> Animesh K wrote:
>> I came across the interesting notion of $a and $$a, which in turns
>> uses the string in $a as a $-suffix to make a new dynamic variable.
>>
>> Can someone illustrate a practical use out of it? I will be very
>> curious to see one (webdesign related) example of its usage.
>>
>> Thanks,
>> Animesh
>>
>
> I agree with Micha. Variable variables are a solution looking for a
> problem. It creates code which is very difficult to manage and update,
> and should not be used.
>

Thanks for the reply. I will stop taxing my brain on the use of variable
variables :)

Best,
Animesh