Re: How to call a static class and method dynamically

From: Date: Mon, 04 Apr 2005 14:04:04 +0000
Subject: Re: How to call a static class and method dynamically
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-212188@lists.php.net to get a copy of this message
class MyClass { function static_method() {
      echo 'I'm in static_method !';
} } You can call the function statically using the double colon ( :: ) operator :
Ahem. Double colon does now works with dynamic names. If I'm not mistaken, call_user_func(array('class', 'function')) is the only way.

« previous php.general (#212188) next »