PHP functions: method_exists and function_exists_php Tutorials

Source: Internet
Author: User

Method_exists

Check if the method of the class exists

< span="">< span="">< span="">< span="">< span="">< span="">)

Checks if the method of the class exists in the specified object

Parameters:

Object: Example or class name

Method_name: Method Name

return value:

Returns True if the method referred to by method_name is defined in the object class referred to by object, otherwise false is returned.

Comments:

If this class is not a known class, using this function uses any registered autoloader.

Function_exists

Returns true if the provided method is already defined.

< span="">< span="">< span="">< span="">)

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

Parameters:

Method name, String type.

return value:

Returns True if the method name exists and is a method, otherwise false is returned.

Note

This function would return FALSE for constructs, such as include_once and Echo.

http://www.bkjia.com/PHPjc/440152.html www.bkjia.com true http://www.bkjia.com/PHPjc/440152.html techarticle Method_exists checks whether a method of the class exists bool (,) checks whether the method of the class exists in the specified object in the argument: object: an example of an instance or a class name Method_name: Method name return value ...

  • Related Article

    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.