didou           Fri May 21 00:55:24 2004 EDT

  Modified files:              
    /phpdoc/en/language constants.xml 
  Log:
  added an example about valid and invalid constant names
  # but every name is valid in fact..
  
http://cvs.php.net/diff.php/phpdoc/en/language/constants.xml?r1=1.35&r2=1.36&ty=u
Index: phpdoc/en/language/constants.xml
diff -u phpdoc/en/language/constants.xml:1.35 phpdoc/en/language/constants.xml:1.36
--- phpdoc/en/language/constants.xml:1.35       Mon Oct 27 06:34:15 2003
+++ phpdoc/en/language/constants.xml    Fri May 21 00:55:23 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.35 $ -->
+<!-- $Revision: 1.36 $ -->
  <chapter id="language.constants">
   <title>Constants</title>
 
@@ -17,8 +17,31 @@
    by any number of letters, numbers, or underscores. As a regular
    expression, it would be expressed thusly:
    <literal>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*</literal>
+  </para>
+  <para>
+   <example>
+    <title>Valid and invalid constant names</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
 
-   <!-- TODO: Example of valid & invalid constant names -->
+// Valid constant names
+define("foo",     "something");
+define("foo2",    "something else");
+define("foo_bar", "something more")
+
+// Invalid constant names
+define("2foo",    "something");
+
+// This is valid, but should be avoided:
+// PHP may one day provide a magical constant
+// that will break your script
+define("__foo__", "something"); 
+
+?>
+]]>
+    </programlisting>
+   </example>
   </para>
   <note>
    <simpara>

Reply via email to