3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $location = new stdClass; $location->city = "Chicago"; //$variableName = 'location->city'; //${$variableName} = 'Chicago'; $str = array("$$location->city Dentist"); var_dump($str[0]);
Output for 4.3.0 - 7.1.10
string(16) "$Chicago Dentist"