diff --git a/language/constants.xml b/language/constants.xml index 6632641b41..046e01c764 100644 --- a/language/constants.xml +++ b/language/constants.xml @@ -232,9 +232,6 @@ echo ANOTHER_CONST; The full path and filename of the file. If used inside an include, the name of the included file is returned. - Since PHP 4.0.2, __FILE__ always contains an - absolute path with symlinks resolved whereas in older versions it contained relative path - under some circumstances. @@ -244,23 +241,18 @@ echo ANOTHER_CONST; the directory of the included file is returned. This is equivalent to dirname(__FILE__). This directory name does not have a trailing slash unless it is the root directory. - (Added in PHP 5.3.0.) __FUNCTION__ - The function name. (Added in PHP 4.3.0) As of PHP 5 this constant - returns the function name as it was declared (case-sensitive). In - PHP 4 its value is always lowercased. + The function name. __CLASS__ - The class name. (Added in PHP 4.3.0) As of PHP 5 this constant - returns the class name as it was declared (case-sensitive). In PHP - 4 its value is always lowercased. The class name includes the namespace + The class name. The class name includes the namespace it was declared in (e.g. Foo\Bar). Note that as of PHP 5.4 __CLASS__ works also in traits. When used in a trait method, __CLASS__ is the name of the class the trait @@ -270,24 +262,20 @@ echo ANOTHER_CONST; __TRAIT__ - The trait name. (Added in PHP 5.4.0) As of PHP 5.4 this constant - returns the trait as it was declared (case-sensitive). The trait name includes the namespace + The trait name. The trait name includes the namespace it was declared in (e.g. Foo\Bar). - __METHOD__ - The class method name. (Added in PHP 5.0.0) The method name is - returned as it was declared (case-sensitive). + The class method name. __NAMESPACE__ - The name of the current namespace (case-sensitive). This constant - is defined in compile-time (Added in PHP 5.3.0). + The name of the current namespace. @@ -301,6 +289,64 @@ echo ANOTHER_CONST; file_exists&listendand; function_exists. + + + Changelog + + + + + + + &Version; + &Description; + + + + + 5.4.0 + + Added __TRAIT__ constant + + + + 5.3.0 + + Added __DIR__ and __NAMESPACE__ constants + + + + 5.0.0 + + Added __METHOD__ constant + + + + 5.0.0 + + Before this version values of some magic constants were always lowercased. + All of them are case-sensitive now (contain names as they were declared). + + + + 4.3.0 + + Added __FUNCTION__ and __CLASS__ constants + + + + 4.0.2 + + __FILE__ always contains an absolute path with symlinks + resolved whereas in older versions it contained relative path + under some circumstances + + + + + + +