PHP obtains the current class name, function name, and method name.

Source: Internet
Author: User
: This article mainly introduces PHP to obtain the current class name, function name, and method name. if you are interested in the PHP Tutorial, refer to it.
      • PHP retrieves several method names of the current class name letter
        • PHP retrieves the current class name
        • Defined Functions

PHP obtains the current class name, function name, and method name.

PHP obtains the current class name and method name.
  • _ CLASS _ get the current CLASS name
  • _ FUNCTION _ current FUNCTION name (confirm)
  • _ METHOD _ current METHOD name (bankcard: confirm)

_ FUNCTION name (new in PHP 4.3.0 ). Starting from PHP 5, this constant returns the name (case sensitive) when the function is defined ). In PHP 4, the value is always lowercase letters.

_ CLASS name (new in PHP 4.3.0 ). Starting from PHP 5, this constant returns the name (case sensitive) when the class is defined ). In PHP 4, the value is always lowercase letters.

_ METHOD _ class METHOD name (new PHP 5.0.0 ). Returns the name (case sensitive) when the method is defined ).

Defined Functions
  • Get_class (class name); // Obtain the class name of the class where the current statement is located.
  • Get_class_methods (class name); // retrieves all the method names of the class name and forms an array
  • Get_class_vars (class name); // retrieves all the highlighted names of the class name and forms an array

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

The above describes how to obtain the current class name, function name, and method name in PHP, including some content, and hope to help those who are interested in the PHP Tutorial.

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.