how this code echo dollardollar as a result? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how this code echo dollardollar as a result?

$dollar = 'dollar'; $dollardollar = $dollar.'dollar'; $dollardollar = $dollar; echo $$dollar;

27th Jun 2017, 5:25 AM
Ahmed Awad
Ahmed Awad - avatar
1 Answer
+ 2
I'm wondering: wouldn't the second line give an error as the variable name (value of $dollardollar) is still empty at that time?
28th Jun 2017, 11:03 PM
Bart Hermans