PHP » PYTHON |
login |
register |
about
|
PYTHON is_callable
is this article helpful?
|
Python replacement for PHP's is_callable
[
edit
| history
]
# Python 2.x and 3.2+: callable(var) # Python 3.0, 3.1 hasattr(var, "__call__") is_callable(PHP 4 >= 4.0.6, PHP 5) is_callable — Verify that the contents of a variable can be called as a function DescriptionVerify that the contents of a variable can be called as a function. This can check that a simple variable contains the name of a valid function, or that an array contains a properly encoded object and function name. Parameters
Return ValuesReturns TRUE if var is callable, FALSE otherwise. Examples
Example #1 is_callable() example
<?php
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|