<?php function GetValue(&$obj, $defaultValue = null) { return isset($obj) ? $obj : $defaultValue; } class foo { public $bar; } $x = new foo(); var_dump(GetValue($x->bar->baz)); ?>
You have javascript disabled. You will not be able to edit any code.