Voting

Please answer this simple SPAM challenge: min(eight, six)?
(Example: nine)

The Note You're Voting On

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

<?php

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

 
$className = 'test';
 
$className::run();

?>

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

<?php

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

?>

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

<< Back to user notes page

To Top