Why do anonymous functions intelligently call static methods of a class?
JasonKim
JasonKim 2019-03-31 14:32:02
0
0
875

// Class
class demos
{
public static function getMethod()
{
return 'The method is:'.__METHOD__;
}

public function getAge(){
return 28;
}
}

// You can call methods in the class
echo call_user_func(['demos','getMethod']) .'<hr>';
//The public method cannot be called
echo call_user_func(['demos','getAge']);

JasonKim
JasonKim

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template