svn: /phpdoc/en/trunk/language/ constants.xml
| From: | Maciej Sobaczewski | Date: | Mon, 04 Aug 2014 07:48:40 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/ constants.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-12695@lists.php.net to get a copy of this message | ||
sobak Mon, 04 Aug 2014 07:48:40 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=334472
Log:
Minor rewrite magic constants section to focus on PHP 5. Changelog added.
Changed paths:
U phpdoc/en/trunk/language/constants.xml
Modified: phpdoc/en/trunk/language/constants.xml
===================================================================
--- phpdoc/en/trunk/language/constants.xml 2014-08-04 06:59:26 UTC (rev 334471)
+++ phpdoc/en/trunk/language/constants.xml 2014-08-04 07:48:40 UTC (rev 334472)
@@ -232,9 +232,6 @@
<entry>
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, <constant>__FILE__</constant> always contains an
- absolute path with symlinks resolved whereas in older versions it contained relative path
- under some circumstances.
</entry>
</row>
<row xml:id="constant.dir">
@@ -244,23 +241,18 @@
the directory of the included file is returned. This is equivalent
to <literal>dirname(__FILE__)</literal>. This directory name
does not have a trailing slash unless it is the root directory.
- (Added in PHP 5.3.0.)
</entry>
</row>
<row xml:id="constant.function">
<entry><constant>__FUNCTION__</constant></entry>
<entry>
- 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.
</entry>
</row>
<row xml:id="constant.class">
<entry><constant>__CLASS__</constant></entry>
<entry>
- 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. <literal>Foo\Bar</literal>).
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 @@
<row xml:id="constant.trait">
<entry><constant>__TRAIT__</constant></entry>
<entry>
- 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. <literal>Foo\Bar</literal>).
</entry>
</row>
-
<row xml:id="constant.method">
<entry><constant>__METHOD__</constant></entry>
<entry>
- 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.
</entry>
</row>
<row xml:id="constant.namespace">
<entry><constant>__NAMESPACE__</constant></entry>
<entry>
- 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.
</entry>
</row>
</tbody>
@@ -301,6 +289,64 @@
<function>file_exists</function>&listendand;
<function>function_exists</function>.
</para>
+
+ <sect2 xml:id="language.constants.predefined.changelog">
+ <title>Changelog</title>
+
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>&Version;</entry>
+ <entry>&Description;</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>5.4.0</entry>
+ <entry>
+ Added <constant>__TRAIT__</constant> constant
+ </entry>
+ </row>
+ <row>
+ <entry>5.3.0</entry>
+ <entry>
+ Added <constant>__DIR__</constant> and
<constant>__NAMESPACE__</constant> constants
+ </entry>
+ </row>
+ <row>
+ <entry>5.0.0</entry>
+ <entry>
+ Added <constant>__METHOD__</constant> constant
+ </entry>
+ </row>
+ <row>
+ <entry>5.0.0</entry>
+ <entry>
+ Before this version values of some magic constants were always lowercased.
+ All of them are case-sensitive now (contain names as they were declared).
+ </entry>
+ </row>
+ <row>
+ <entry>4.3.0</entry>
+ <entry>
+ Added <constant>__FUNCTION__</constant> and
<constant>__CLASS__</constant> constants
+ </entry>
+ </row>
+ <row>
+ <entry>4.0.2</entry>
+ <entry>
+ <constant>__FILE__</constant> always contains an absolute path with symlinks
+ resolved whereas in older versions it contained relative path
+ under some circumstances
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </sect2>
</sect1>
</chapter>