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

call_user_method() function in PHP

PHPz
PHPzforward
2023-09-08 09:17:06882browse

call_user_method() function in PHP

call_user_method() function calls a user method on a specific object.

Note - This function is now deprecated.

grammar

call_user_method(method, obj, params)

parameter

  • Method - Method name

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

  • params - parameter array

alternative plan

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

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

The above is the detailed content of call_user_method() 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