[PHP-DOC] cvs: phpdoc /it/language variables.xml From: Luca Perugini (l.perugini <email protected>)
Date: 08/31/00

perugini Thu Aug 31 15:26:37 2000 EDT

  Modified files:
    /phpdoc/it/language variables.xml
  Log:
  Sync with en tree.
  
  
Index: phpdoc/it/language/variables.xml
diff -u phpdoc/it/language/variables.xml:1.1 phpdoc/it/language/variables.xml:1.2
--- phpdoc/it/language/variables.xml:1.1 Sat Dec 18 17:01:09 1999
+++ phpdoc/it/language/variables.xml Thu Aug 31 15:26:37 2000
@@ -4,17 +4,40 @@
   <sect1 id="language.variables.basics">
    <title>Basics</title>
 
- <para>
+ <simpara>
     Variables in PHP are represented by a dollar sign followed by the
     name of the variable. The variable name is case-sensitive.
+ </simpara>
+
+ <para>
+ Variable names follow the same rules as other labels in PHP. A
+ valid variable name starts with a letter or underscore, followed
+ by any number of letters, numbers, or underscores. As a regular
+ expression, it would be expressed thus:
+ '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
+ </para>
+
+ <note>
+ <simpara>
+ For our purposes here, a letter is a-z, A-Z, and the ASCII
+ characters from 127 through 255 (0x7f-0xff).
+ </simpara>
+ </note>
+
+ <para>
     <informalexample>
      <programlisting role="php">
 $var = "Bob";
 $Var = "Joe";
-echo "$var, $Var"; // outputs "Bob, Joe"
+echo "$var, $Var"; // outputs "Bob, Joe"
+
+$4site = 'not yet'; // invalid; starts with a number
+$_4site = 'not yet'; // valid; starts with an underscore
+$täyte = 'mansikka'; // valid; 'ä' is ASCII 228.
      </programlisting>
     </informalexample>
    </para>
+
    <para>
     In PHP3, variables are always assigned by value. That is to say,
     when you assign an expression to a variable, the entire value of
@@ -648,7 +671,7 @@
 
     $count++;
     echo $count;
- if ($count < 10) {
+ if ($count &lt; 10) {
         Test ();
     }
     $count--;