Variable as static function
I have a class Sections:
class Sections {
public static function get($name) {
//
}
}
And I would like to call a static get () function from it with a variable ( http://php.net/manual/en/functions.variable-functions.php ):
$section = 'Sections::get';
$section('body');
But it gives me a fatal error: function call undefined Sections :: get ()
Can a static function be called this way?
Thank!
+3
source to share
3 answers