您的位置:寻梦网首页编程乐园PHP 编程PHP5中文手册
PHP5中文手册

__NAMESPACE__

The compile-time constant __NAMESPACE__ is defined to the name of the current namespace. Outside namespace this constant has the value of empty string. This constant is useful when one needs to compose full name for local namespaced names.

Example#1 Using __NAMESPACE__

<?php
namespace A
::B::C;
         
function 
foo() {
// do stuff
}

set_error_handler(__NAMESPACE__ "::foo");
?>