note 46421 added to language.oop5.paamayim-nekudotayim
| From: | JoschaFeth | Date: | Sun, 10 Oct 2004 19:39:27 +0000 |
| Subject: | note 46421 added to language.oop5.paamayim-nekudotayim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78309@lists.php.net to get a copy of this message | ||
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();"));
?>
----
Manual Page -- http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46421
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46421&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46421&report=yes
Search -- http://master.php.net/manage/user-notes.php