Magic constants _ FILE _, _ LINE _ ,__ FUNCTION _ in php

Source: Internet
Author: User
_ FILE _: current FILE name _ LINE _: current row number _ FUNCTION _: current FUNCTION name _ CLASS _: current CLASS name _ METHOD _: the so-called magic constant of the current METHOD name, not a real constant, but a root

_ FILE _: current FILE name

_ LINE _: current row number

_ FUNCTION _: current FUNCTION name

_ CLASS _: current CLASS name

_ METHOD _: current METHOD name

The so-called magic constant is not a real constant, but a variable that gets a fixed value based on the occasion. the code is as follows:

  1. Echo _ FILE __;
  2. Echo'
    ';
  3.  
  4. Echo _ LINE __;
  5. Echo'
    ';
  6.  
  7. Function funcTest ()
  8. {
  9. Echo _ FUNCTION __;
  10. }
  11. FuncTest ();
  12. ?>

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.