Notes for using call_user_func functions in php: calluserfunc. Notes for using call_user_func functions in php. calluserfunc this article describes the precautions for using call_user_func functions in php. Share it with you for your reference. The specific analysis is as follows: Considerations for using call_user_func function in php, calluserfunc
This example describes the precautions for using the call_user_func function in php. Share it with you for your reference. The specific analysis is as follows:
Notes for call_user_func: parse error: syntax error, unexpected t_list, expecting t_string in, please refer to the official manual and do not introduce any precautions for using it.
Appendix: mixed call_user_func (callback $ function [, mixed $ parameter [, mixed $...]). any built-in or user-defined functions can be passed, except for the language structures such as array (), echo (), empty (), eval (), exit (), isset (), list (), print () and unset ().
My problem is that there is a list method name 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 to call a function. the usage is as follows:
The code is as follows:
Function a ($ B, $ c)
{
Echo $ B;
Echo $ c;
}
Call_user_func ('a, "111", "222 ");
Call_user_func ('a, "333", "444 ");
// Display 111 222 333 444
The internal method of calling the class is strange. the method actually uses an array and does not know how developers think about it. of course, the new method is saved and the code is full of new ideas. the code is as follows:
The code is as follows:
Class {
Function B ($ c)
{
Echo $ c;
}
}
Call_user_func (array ("a", "B"), "111 ");
// Display 111
The call_user_func_array function is similar to call_user_func, but the parameter is passed in another way to make the parameter structure clearer. the code is as follows:
The code is as follows:
Function a ($ B, $ c)
{
Echo $ B;
Echo $ c;
}
Call_user_func_array ('A', array ("111", "222 "));
// Display 111 222
I hope this article will help you with php programming.
Examples in this article describes the precautions for using call_user_func functions in php. Share it with you for your reference. The specific analysis is as follows :...