Computer >> Computer tutorials >  >> Programming >> PHP

call_user_method_array() function in PHP


The call_user_method_array() function call a user method given with an array of parameters.

Note − The function is deprecated now.

Syntax

call_user_method_array(method, obj, params)

Parameters

  • method − Method name

  • obj − Object that method is being called on.

  • params − Array of parameters

Alternative

Since the call_user_method_array() deprecated in PHP 4.1.0, and removed in PHP 7.0, therefore use the following as an alternative solution −

call_user_func_array(array($obj, $method), $params);