Page 1 of 1

Some $ function

Posted: Sun Dec 13, 2009 9:12 pm
by ngungo
I forgot where I've seen this piece of code. Something I am not aware of:

Code: Select all

$foo = 100;
$bar = "something and '${foo}' more."; 

or something like that. So how does that work?
I've tried to look it up but not find any reference. Any hints would be appreciated.

Re: Some $ function

Posted: Sun Dec 13, 2009 9:55 pm
by requinix
Is it still on my clipboard? Hmm, nope.

Strings. See the "variable parsing" section.

Re: Some $ function

Posted: Sun Dec 13, 2009 10:44 pm
by s.dot
Perhaps you are talking about "variable variables"

Re: Some $ function

Posted: Sun Dec 13, 2009 11:28 pm
by Cirdan

Re: Some $ function

Posted: Mon Dec 14, 2009 12:48 am
by requinix
Most times people try to use it they're doing it for the wrong reason, but there are legitimate uses for it. It's just not something seen in many other languages so it has this "if nobody else is doing it then it must be bad" stigma.