Please answer this simple SPAM challenge: one minus zero?
(Example: nine)

The Note You're Voting On

dances_with_peons at live dot com
7 years ago
As of PHP 5.3, $className::funcName() works fine.


class test
    public static function
run() { print "Works\n"; }

$className = 'test';


on my system, prints "Works".  May work with earlier versions of PHP as well.  Even if it doesn't, there's always


= 'test';
call_user_func(array($className, 'run'));


The point is, there's no need for eval.

<< Back to user notes page

To Top