3v4l.org

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