method_exists
bool method_exists(object obj, string method_name)
obj | Object to test for the existence of the given method |
method_name | Method name to test for existence in the given object |
Tests for the existence of a method within an object.
Returns:
TRUE if the method exists in the given object; FALSE if obj is not an object or the method doesn’t exist in the object
Description:
method_exists() tests for the existence of a given method within a given object. Returns TRUE if the method exists within the object. If the method doesn’t exist within the object, or if obj is not an object, returns FALSE.
Availability:
UNIX, Windows
Version:
4.0b2+
See also:
To find the member variables (and their values) for a class or an object:
get_class_vars() ...
Get PHP Functions Essential Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.