Where can I find the double dollar syntax link?

I hope everyone here knows the syntax of the php variable variable:

$color = 'red';
$red = 'yes, im red';
echo $$color;
//output: 'yes, im red';

but my problem is: what is this syntax called? I am trying to find a link to php.net without any results (I want to know if this function will be stored in php6, other attributes, etc.)

+3
source share
3 answers

Variable variables

And yes, this will be saved in PHP6, as far as I know.

+7
source

Just to share some tips.

To avoid confusion, you can use curly braces.

${$color}

One of my team members deleted a double $, thinking of a typo error. Perhaps this will avoid confusion.

+5
source

php , , /, .

0
source

Source: https://habr.com/ru/post/1706386/


All Articles