Re: APC and PHP 5.1.2

From: Date: Thu, 02 Mar 2006 21:36:51 +0000
Subject: Re: APC and PHP 5.1.2
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-231372@lists.php.net to get a copy of this message
:) On 3/2/06, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: > steve wrote: > > OK, will try. Does this work in the CVS version? > > > > <?php > > error_reporting(E_ALL); > > class A > > { > > public $_t = 'something'; > > public function __get($name) > > { > > $getter='get'.$name; > > if(method_exists($this,$getter)) > > { > > // getting a property > > return $this->$getter(); > > } > > } > > > > public function getTest() > > { > > return 'OK'; > > } > > } > > $result=''; > > $one = new A(); > > var_dump($one); > > echo "<BR>Test \$one->getTest(): "; > > echo $one->getTest(); > > echo "<BR>Test \$one->Test: "; > > echo $one->Test; > > echo "<BR>Test with eval: "; > > eval ('$result = $one->Test; '); > > echo $result; > > echo "<BR>Testing done."; > > It outputs: > object(A)#1 (1) { ["_t"]=> string(9) "something" } > Test $one->getTest(): OK > Test $one->Test: OK > Test with eval: OK > Testing done. > >

« previous php.general (#231372) next »