This shows you the differences between two versions of the page.
uphp:functions:call_user_func [2017/04/06 14:54] jeff |
uphp:functions:call_user_func [2021/09/13 05:57] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======call_user_func====== | ||
- | |||
- | < | ||
- | |||
- | Call a user defined function with optional parameters | ||
- | |||
- | ====Description==== | ||
- | |||
- | <well size=" | ||
- | < | ||
- | <span style=" | ||
- | <span style=" | ||
- | </ | ||
- | [[call_user_func]] ( | ||
- | < | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | </ | ||
- | </ | ||
- | |||
- | Return result as defined by the user function | ||
- | |||
- | ====Parameters==== | ||
- | |||
- | < | ||
- | |||
- | < | ||
- | |||
- | ====Return Value==== | ||
- | |||
- | Any type depending on the way the function is defined | ||
- | |||
- | ====Example==== | ||
- | |||
- | <code php> | ||
- | <? | ||
- | function my_add($x, | ||
- | return $x+$y; | ||
- | } | ||
- | $result=call_user_func(" | ||
- | print($result); | ||
- | ?> | ||
- | </ | ||
- | |||
- | ====See Also==== | ||
- | |||
- | [[function_exists()]] - Check if a function exists (native or custom) | ||
- | |||
- | [[uphp: | ||
- | |||
- | [[uphp: | ||
- | |||
- | ====Additional Information==== | ||
- | |||
- | User defined functions can take many different forms, and it is not necessary to use [[call_user_func()]] to execute a function unless a direct return value is needed. | ||
- | |||
- | If used within a function, the [[uphp: | ||