mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fixed PHP bug #51340 (const keyword inside code blocks causes parse error)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@296726 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
50dee02eea
commit
7df1c871ff
1 changed files with 10 additions and 0 deletions
|
@ -168,6 +168,16 @@ echo CONSTANT;
|
|||
</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>
|
||||
|
|
Loading…
Reference in a new issue