- var_dump: documentation ( source)
<?php
$variableName = 'location->city';
// Create new variable with the name defined in variable $variableName
${$variableName} = 'Chicago';
//Outputs: string(7) "MyValue"
var_dump($location->city);
//Outputs: string(7) "MyValue"
var_dump(${'location->city'});