PHP Beginner's Guide to Magic Variables
PHP provides a large number of predefined constants to any script it runs.
However, many constants are defined by different extension libraries and will only appear when these extension libraries are loaded, or after dynamic loading, or have been included during compilation.
1.__LINE__
The current line number in the file
2.__FILE__
The full path and file name of the file. If used within an included file, returns the name of the included file.
Since PHP 4.0.2, __FILE__ always contains an absolute path (or the resolved absolute path if it is a symbolic link), while versions before that sometimes contained a relative path
3.__DIR__
The directory where the file is located. If used within an included file, returns the directory where the included file is located.
It is equivalent to dirname(__FILE__). Directory names do not include the trailing slash unless they are the root directory. (New in PHP 5.3.0)
__FUNCTION__
5.__CLASS__
"; echo '函数名为:' . __FUNCTION__ ; } } $t = new test(); $t->_print(); ?>
__METHOD__