note 100801 modified in language.oop5 by sthulbourn
| From: | sthulbourn@php.net | Date: | Mon, 08 Nov 2010 11:35:51 +0000 |
| Subject: | note 100801 modified in language.oop5 by sthulbourn | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173843@lists.php.net to get a copy of this message | ||
Dave, please consider this approach:
<?php
class Foo{
public static function bar(){
echo 'Hello world!';
}
}
call_user_func(array('Foo', 'bar'));
?>
--was--
Dave, please consider this approach:
<?php
class Foo{
public static function bar(){
echo "Hello world!";
}
}
call_user_func("Foo::bar");
?>
http://php.net/manual/en/language.oop5.php