PHP functions: method_exists and function_exists_PHP tutorial

Source: Internet
Author: User
PHP functions: method_exists and function_exists. Method_exists check whether the method of the class has bool (,) check whether the method of the class exists in the specified object. parameter: object example or class name method_name: method name return value method_exists

Check whether the class method exists

 bool  (   ,   )

Check whether the class method exists in the specified object.

Parameters:

Object: object example or class name

Method_name: method name

Return value:

If the method referred to by method_name has been defined in the object class referred to by the object, TRUE is returned; otherwise, FALSE is returned.

Note:

If this class is not a known class, use this function to use any registered autoloader.

Function_exists

Returns TRUE if the provided method has been defined.

 bool  (   )

Check the list of defined methods, including built-in (PHP internal) and user-defined methods.

Parameters:

Method name, string type.

Return value:

If the method name exists and is a method, TRUE is returned; otherwise, FALSE is returned.

Note:

This function will returnFALSEFor constructs, such as include_once and echo.

The http://www.bkjia.com/PHPjc/440152.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/440152.htmlTechArticlemethod_exists checks whether the method of the class has bool (,) checks whether the method of the class exists in the specified object parameter: object example or class name method_name: method name return value...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.