Help, I get a syntax error on
$obj->get("this")->set("hello");
where
class H {
var $v = null;
function set($val) {
$this->v = $val;
}
}
class OBJ {
var $a = array();
function get($name) {
return $this->a[$name];
}
function add($name,$object) {
$this->a[$name] = $object;
}
}
$obj = new OBJ();
$obj->add("this", new H());
$obj->get("this")->set("hello");
Does PHP evalutate this such that $obj->get("this") is returned, then ->set("hello") is then evaluated? OR did I screw up something in the syntax?
Thanks