call_user_method

mixed call_user_method(string method_name, object obj, 
 [mixed method_parameter], [mixed ...]) 
method_name Method to be called
obj Object to which method_name belongs
method_parameter First argument to be passed to method_name
... Additional arguments to be passed to method_name

Alternate method for calling a method from an object.

Returns:

Return value of method_name ; FALSE if obj is not an object

Description:

call_user_method() provides an alternate syntax for calling object methods. This function is primarily useful as a way to dynamically call methods at runtime without requiring eval().

Normally, methods are called with the following syntax:

$object->method ('arg one', 'arg two', ...); 

Calling the same method ...

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.