call_user_func
PHP 4, PHP 5, PHP 7, PHP 8
call_user_func - Call the callback given by the first parameter
Example #1 call_user_func example
Result: You wanted a mushroom haircut, no problem
You wanted a shave haircut, no problem
Example #2 call_user_func using namespace name
Result: Hello world!
Hello world!
Example #3 Using a class method with call_user_func
Result: Hello!
Hello!
Hello!
Example #4 Using lambda function with call_user_func
Result: [test]