philip          Thu Mar  9 06:39:45 2006 UTC

  Modified files:              
    /phpdoc/en/language types.xml 
  Log:
  implemented user note: example variables such as $bool and $int may be 
confusing 
  to some users coming from C/Java, using $a_bool, $an_int, etc. instead.
  
  
http://cvs.php.net/viewcvs.cgi/phpdoc/en/language/types.xml?r1=1.160&r2=1.161&diff_format=u
Index: phpdoc/en/language/types.xml
diff -u phpdoc/en/language/types.xml:1.160 phpdoc/en/language/types.xml:1.161
--- phpdoc/en/language/types.xml:1.160  Tue Mar  7 00:51:47 2006
+++ phpdoc/en/language/types.xml        Thu Mar  9 06:39:45 2006
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.160 $ -->
+<!-- $Revision: 1.161 $ -->
  <chapter id="language.types">
   <title>Types</title>
 
@@ -128,22 +128,23 @@
      <programlisting role="php">
 <![CDATA[
 <?php
-$bool = TRUE;   // a boolean
-$str  = "foo";  // a string
-$int  = 12;     // an integer
+$a_bool = TRUE;   // a boolean
+$a_str  = "foo";  // a string
+$a_str2 = 'foo';  // a string
+$an_int = 12;     // an integer
 
-echo gettype($bool); // prints out "boolean"
-echo gettype($str);  // prints out "string"
+echo gettype($a_bool); // prints out:  boolean
+echo gettype($a_str);  // prints out:  string
 
 // If this is an integer, increment it by four
-if (is_int($int)) {
-    $int += 4;
+if (is_int($an_int)) {
+    $an_int += 4;
 }
 
 // If $bool is a string, print it out
 // (does not print out anything)
-if (is_string($bool)) {
-    echo "String: $bool";
+if (is_string($a_bool)) {
+    echo "String: $a_bool";
 }
 ?>
 ]]>

Reply via email to