note 46421 deleted from language.oop5.paamayim-nekudotayim by tularis

From: Date: Sun, 10 Oct 2004 21:46:40 +0000
Subject: note 46421 deleted from language.oop5.paamayim-nekudotayim by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-78312@lists.php.net to get a copy of this message
Note Submitter: Joscha Feth <joscha at feth dot com> ---- Someone might come over the problem not to know the classname, he needs to make a static function call from: <?php class Foo { public static $bla = array('a','b'); public static function getBla() { return self::$bla; } } //~ works as desired print_r(Foo::getBla()); $classname = 'Foo'; //~ gives a parse error 'T_PAAMAYIM_NEKUDOTAYIM' print_r($classname::getBla()); //~ not nice, but works print_r(eval("return $classname::getBla();")); ?>

« previous php.notes (#78312) next »