Help, I get a syntax error on

 $obj->get("this")->set("hello");

where

class H {
  var $v = null;
  function H () {
  }
  function set($val) {
    $this->v = $val;
  }
}

class OBJ {
  var $a = null;
  function OBJ() {
    $this->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 allow this?
Why / Why Not?

Thanks



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to