Home  >  Article  >  Backend Development  >  call_user_method_array() function in PHP

call_user_method_array() function in PHP

WBOY
WBOYforward
2023-09-05 12:49:05853browse

call_user_method_array() function in PHP

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

Note - This function is now deprecated.

Syntax
call_user_method_array(method, obj, params)

Parameters

  • Method - Method name

  • obj - The object on which the method is being called.

  • params - Parameter array

  • ul>

    Replacement

    Since call_user_method_array() in PHP 4.1.0 is deprecated and removed in PHP 7.0, so use the following as an alternative solution -

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

The above is the detailed content of call_user_method_array() function in PHP. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete