Re: Does PHP allow $obj->get("this")->set("hello");

From: Date: Sun, 21 Oct 2001 17:19:52 +0000
Subject: Re: Does PHP allow $obj->get("this")->set("hello");
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-68636@lists.php.net to get a copy of this message
Does anyone know the correct technical name for this so I can keep an eye out for it in the future releases? Thanks --Geoff Zeev Suraski wrote: > No, it doesn't. A future version will... > > At 19:10 21-10-01, Geoff Hibble wrote: > >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: php-dev-unsubscribe@lists.php.net > >For additional commands, e-mail: php-dev-help@lists.php.net > >To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#68636) next »