barvalueaMemberVar Member Variable
$obj = (object) array('foo' => 'bar', 'property' => 'value'); echo $obj->foo; // prints 'bar' echo $obj->property; // prints 'value' --- class Foo { public $aMemberVar = 'aMemberVar Member Variable'; public $aFuncName = 'aMemberFunc'; function aMemberFunc() { print 'Inside `aMemberFunc()`'; } } $foo = new Foo; $element = 'aMemberVar'; print $foo->$element; // prints "aMemberVar Member Variable" --- http://php.net/manual/en/language.oop5.php http://thaiall.com/php5 ---