PHP » PYTHON |
login |
register |
about
|
PYTHON call_user_func
is this article helpful?
|
Python replacement for PHP's call_user_func
[
edit
| history
]
# if you already have a function object: result = function(param1, ...) # duh # if you have the name of the function: result = eval(function_name)(param1, ...) call_user_func(PHP 4, PHP 5) call_user_func — Call a user function given by the first parameter DescriptionCall a user defined function given by the function parameter. Parameters
Return ValuesReturns the function result, or FALSE on error. Examples
Example #1 call_user_func() example
<?php
Example #2 call_user_func() using namespace name
<?php
Example #3 Using a class method
<?php
Example #4 Using lambda function
<?php
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|