<?php
/**
*__LINE__ The function name.
*__FILE__ The full path and filename of the file with symlinks resolved. If
used inside an include, the name of the included file is returned.
*__DIR__ The directory of the file.
*__FUNCTION__ The function name.
*__CLASS__ The class name.
*__TRAIT__ The trait name. The trait name includes the namespace it was
declared in (e.g. Foo\Bar).
*__METHOD__ The class method name.
*__NAMESPACE__ The name of the current namespace.
*/
function test_fun()
{
echo __FUNCTION__;
}
echo __LINE__,'<br/>'; //18
echo __FILE__,'<br/>'; //D:\wamp\apps\test\dir.php
echo dirname(__FILE__),'<br/>';//D:\wamp\apps\test
echo __DIR__,'<br/>'; //D:\wamp\apps\test
echo dirname(__DIR__),'<br/>'; //D:\wamp\apps
test_fun(); //test_fun
?>
php常用的魔法变量
最新推荐文章于 2024-08-09 09:38:39 发布