The following content is from the official Php.net document
Callbacks
Functions such as Call_user_func (), Usort () accept user-defined callback functions as parameters.
A callback function can be more than just a simple function, or it can be an object method, including a static method of an object.
PHP functions can be called by the function name of a string type, and any built-in or user-defined functions can be used. But that doesn't include
PHP language structure, such as: Array (), Echo,empty (), eval (), exit (), Isset (), List (), Print,unset ()
The method of invoking a class is called by using the name of the instantiated object and the calling method, respectively, as the No. 0 and 1th parameters of the array.
A static method that invokes a class can invoke the name of the class and the name of the static method as the No. 0 and 1th arguments of the array, respectively, without instantiating the object of the class.
After php5.2.3, you can also invoke the static method of the class by using Classname::methodname.
In addition to these generic user-defined functions, anonymous functions can also be used as function arguments.
<?php//An example callback Functionfunction my_callback_function () { echo ' Hello world! ';} An example callback Methodclass MyClass { static function Mycallbackmethod () { echo ' Hello world! '; }} Type 1:simple callbackcall_user_func (' my_callback_function '); Type 2:static class Method Callcall_user_func (Array (' MyClass ', ' Mycallbackmethod ')); Type 3:object Method call$obj = new MyClass () Call_user_func (Array ($obj, ' Mycallbackmethod '));//Type 4:static class Method call (as of PHP 5.2.3) call_user_func (' Myclass::mycallbackmethod ');//Type 5:relative Static class method call (as of PHP 5.3.0) class A {public static function who () { echo "a\n"; }} Class B extends A {public static function who () { echo "b\n";