Home >Backend Development >PHP Tutorial >Precautions for using the call_user_func function in PHP, calluserfunc_PHP tutorial
The example in this article describes the precautions for using the call_user_func function in PHP. Share it with everyone for your reference. The specific analysis is as follows:
Notes on the call_user_func function: parse error: syntax error, unexpected t_list, expecting t_string in. When using this function today, I kept getting prompted with the above problem. The official manual did not introduce the precautions for using it.
Attachment: mixed call_user_func(callback $function [, mixed $parameter [, mixed $... ]]). You can pass any built-in or user-defined function, except language structures such as array(), echo() ,empty(),eval(),exit(),isset(),list(),print() and unset().
My problem is that there is a method name called list in the object, so it conflicts with the language structure list() of the PHP tutorial.
Look at the example application: the call_user_func function is similar to a special method of calling a function. The usage method is as follows:
I hope this article will be helpful to everyone’s PHP programming design.