3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( 'id' => '4', 'realid' => '4', 'address_rev' => NULL, 'relation_data_id' => '3', 'contact_set_rev' => '3', 'business_data_rev' => '4', 'private_data_rev' => NULL, // etc.. ); $variableName = 'MyVariable'; // Create new variable with the name defined in variable $variableName ${$variableName} = $a['id']; $s = "aaaa = ${$variableName}"; echo $s; ?>
Output for 4.3.0 - 7.1.0
aaaa = 4