This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
uphp:functions:call_user_func [2017/03/01 12:32] jeff |
uphp:functions:call_user_func [2021/09/13 05:57] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ======call_user_func====== | ======call_user_func====== | ||
| + | |||
| < | < | ||
| Line 5: | Line 6: | ||
| ====Description==== | ====Description==== | ||
| - | <well size=" | + | |
| - | <span style=" | + | <well size=" |
| - | < | + | <span style=" |
| - | <span style=" | + | <span style=" |
| - | <span style=" | + | <span style=" |
| - | <span style=" | + | <span style=" |
| - | <span style=" | + | <span style=" |
| - | <span style=" | + | <span style=" |
| - | <span style=" | + | <span style=" |
| + | <span style=" | ||
| </ | </ | ||
| + | |||
| Return result as defined by the user function | Return result as defined by the user function | ||
| ====Parameters==== | ====Parameters==== | ||
| - | < | ||
| - | < | + | <html><b>< |
| - | ====Return | + | < |
| - | Any type depending on the way the function is defined | + | |
| + | ====Return | ||
| + | |||
| + | < | ||
| ====Example==== | ====Example==== | ||
| - | <code php><? | + | |
| - | function my_add($x, | + | <code php> |
| - | return $x+$y; | + | <? |
| - | } | + | function my_add($x, |
| - | $result=call_user_func(" | + | return $x+$y; |
| - | print($result); | + | } |
| - | ?></ | + | $result=call_user_func(" |
| + | print($result); | ||
| + | ?> | ||
| + | </ | ||
| ====See Also==== | ====See Also==== | ||
| + | |||
| + | [[function_exists()]] - Check if a function exists (native or custom) | ||
| + | |||
| [[uphp: | [[uphp: | ||
| Line 40: | Line 51: | ||
| ====Additional Information==== | ====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. | 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: | If used within a function, the [[uphp: | ||
| + | |||