PHP magic constant .? Php ************ note part of the magic constant 1: Unable to manually modify his value, so called constant 2: But the value changes with the environment, so it's called Magic --- magic constant _ FILE _ return /****
****/
/***
=== Note ====
Magic constant
1: The value cannot be manually modified, so it is called a constant.
2: But the value changes with the environment, so it is called Magic
--- Magic constant
_ FILE _ return the path of the current FILE.
Used to calculate the root directory of a website in framework development or website initialization scripts
_ LINE _ returns the current row number.
In the framework, it can be used to record error information during debugging.
_ CLASS _ returns the current CLASS name
_ METHOD _ returns the current METHOD name.
***/
Echo 'the currently running is ',__ FILE __, 'file ','
';
Echo 'current in ',__ DIR __,' Directory
';
Echo 'Hi, I am at ',__ LINE __,'
';
Echo 'hello, I am at ',__ LINE __,'
';
Echo 'Hehe, I am at ',__ LINE __,'
';
Class Human {
Public static function t (){
Echo 'You are running ',__ CLASS __,' CLASS
';
Echo ',__ METHOD __, 'method ';
}
}
Human: t ();
Http://www.bkjia.com/PHPjc/477907.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477907.htmlTechArticle? Php/******** // ***** === Note ==== Magic constant 1: Unable to manually modify his value, so it is called constant 2: But the value changes with the environment, so it is called Magic --- magic constant _ FILE _ to return...