I am examining some PHP code written by somebody else, and they have basically named a variable $text
:
protected $text = null;
And then later in the same file, they are referring to it without the $
sign:
$this->text[$name] = new Text($age, $house);
- I am a little intrigued. Is this even possible? Can a variable named
with a
$
concatenated with some word, be referred with only the part of the identifier other than$
? - If yes, does it imply something special or is it a simple reference to the variable?
PS: I don't think the code is faulty because it works =s