- print_r: documentation ( source)
<?php
class template
{
public $property = 'hello';
}
class object
{
public $template;
public $hello = 'hi';
}
$object = new object();
$object->template = new template();
$path = $object->template->property;
$value = $object->{$path};
print_r($value);