call_user_method() function in PHP

PHPz
Release: 2023-09-08 09:18:02
forward
906 people have browsed it

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)
Copy after login

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);
Copy after login

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!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template