[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] cvs: phpdoc /en/language constants.xml
From:       "Kalle Sommer Nielsen" <kalle () php ! net>
Date:       2008-11-30 22:13:28
Message-ID: cvskalle1228083208 () cvsserver
[Download RAW message or body]

kalle		Sun Nov 30 22:13:28 2008 UTC

  Modified files:              
    /phpdoc/en/language	constants.xml 
  Log:
  State that constants can be defined using the const keyword outside a class def. as of PHP 5.3.0
  
http://cvs.php.net/viewvc.cgi/phpdoc/en/language/constants.xml?r1=1.52&r2=1.53&diff_format=u
Index: phpdoc/en/language/constants.xml
diff -u phpdoc/en/language/constants.xml:1.52 phpdoc/en/language/constants.xml:1.53
--- phpdoc/en/language/constants.xml:1.52	Tue Jun  3 08:07:20 2008
+++ phpdoc/en/language/constants.xml	Sun Nov 30 22:13:27 2008
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.52 $ -->
+<!-- $Revision: 1.53 $ -->
  <chapter xml:id="language.constants" xmlns="http://docbook.org/ns/docbook">
   <title>Constants</title>
 
@@ -62,8 +62,10 @@
    <title>Syntax</title>
    <simpara>
     You can define a constant by using the 
-    <function>define</function>-function. Once a constant is defined,
-    it can never be changed or undefined.
+    <function>define</function>-function or by using the 
+    <literal>const</literal> keyword outside a class definition as 
+    of PHP 5.3.0. Once a constant is defined, it can never be 
+    changed or undefined.
    </simpara>
    <simpara>
     Only scalar data (<type>boolean</type>, <type>integer</type>, 
@@ -147,7 +149,22 @@
 ]]>
      </programlisting>
     </example>
+   </para>
 
+   <para>
+    <example>
+     <title>Defining Constants using the <literal>const</literal> keyword</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+// Works as of PHP 5.3.0
+const CONSTANT = 'Hello World';
+
+echo CONSTANT;
+?>
+]]>
+     </programlisting>
+    </example>
    </para>
 
    <simpara>



-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic