svn: /phpdoc/en/trunk/language/ constants.xml
| From: | Daniel Egeberg | Date: | Wed, 24 Mar 2010 15:33:08 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/ constants.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6259@lists.php.net to get a copy of this message | ||
degeberg Wed, 24 Mar 2010 15:33:08 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=296726
Log:
Fixed PHP bug #51340 (const keyword inside code blocks causes parse error)
Bug: http://bugs.php.net/51340 (Open) const keyword inside
code blocks causes parse error.
Changed paths:
U phpdoc/en/trunk/language/constants.xml
Modified: phpdoc/en/trunk/language/constants.xml
===================================================================
--- phpdoc/en/trunk/language/constants.xml 2010-03-24 15:21:26 UTC (rev 296725)
+++ phpdoc/en/trunk/language/constants.xml 2010-03-24 15:33:08 UTC (rev 296726)
@@ -168,6 +168,16 @@
</example>
</para>
+ <note>
+ <para>
+ As opposed to defining constants using <function>define</function>,
+ constants defined using the <literal>const</literal> keyword must be
+ declared at the top-level scope because they are defined at compile-time.
+ This means that they cannot be declared inside functions, loops or
+ <literal>if</literal> statements.
+ </para>
+ </note>
+
<simpara>
See also <link linkend="language.oop5.constants">Class Constants</link>.
</simpara>