3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $variableName = 'MyVariable'; // Create new variable with the name defined in variable $variableName ${$variableName} = 'MyValue'; //Outputs: string(7) "MyValue" var_dump($MyVariable); //Outputs: string(7) "MyValue" var_dump(${'MyVa1riable'});
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(7) "MyValue" Notice: Undefined variable: MyVa1riable in /in/gd7Xe on line 8 NULL
Output for 4.3.0 - 5.0.3
string(7) "MyValue" Notice: Undefined variable: MyVa1riable in /in/gd7Xe on line 8 NULL