3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $variableName = 'MyVariable'; // Create new variable with the name defined in variable $variableName $obj = (object) array( "foo" => "1", "bar" => "2", ); echo $obj->foo; ${$variableName} = 'MyValue'; //Outputs: string(7) "MyValue" echo $MyVariable;
based on Apr5v
Output for 4.3.0 - 7.2.0
1MyValue