[PHP-DEV] CVS update: php3/doc/chapters From: eschmid (php-dev <email protected>)
Date: 02/28/99

Date: Sunday February 28, 1999 @ 2:31
Author: eschmid

Update of /repository/php3/doc/chapters
In directory asf:/u/temp/cvs-serv25174

Modified Files:
        lang-syntax.sgml
Log Message:
Minor fix and added Alexander's annotation.
Index: php3/doc/chapters/lang-syntax.sgml
diff -c php3/doc/chapters/lang-syntax.sgml:1.30 php3/doc/chapters/lang-syntax.sgml:1.31
*** php3/doc/chapters/lang-syntax.sgml:1.30 Mon Feb 15 08:08:14 1999
--- php3/doc/chapters/lang-syntax.sgml Sun Feb 28 02:31:05 1999
***************
*** 9,21 ****
     <title>Escaping from HTML</title>
    
     <para>
! There are three ways of escaping from HTML and entering "PHP code
      mode":
  
      <example>
       <title>Ways of escaping from HTML</title>
       <programlisting>
! 1. &lt;? echo("this is the simplest, an SGML processing instruction\n"); ?>
  
  2. &lt;?php echo("if you want to serve XML documents, do like this\n"); ?>
  
--- 9,21 ----
     <title>Escaping from HTML</title>
    
     <para>
! There are four ways of escaping from HTML and entering "PHP code
      mode":
  
      <example>
       <title>Ways of escaping from HTML</title>
       <programlisting>
! 1. &lt;? echo ("this is the simplest, an SGML processing instruction\n"); ?>
  
  2. &lt;?php echo("if you want to serve XML documents, do like this\n"); ?>
  
***************
*** 24,30 ****
                 like processing instructions");
      &lt;/script>;
  
! 4. &lt;% echo("As of PHP 3.0.4 you may optionally use ASP-style tags"); %>
       </programlisting>
      </example>
  
--- 24,30 ----
                 like processing instructions");
      &lt;/script>;
  
! 4. &lt;% echo ("As of PHP 3.0.4 you may optionally use ASP-style tags"); %>
       </programlisting>
      </example>
  
***************
*** 523,541 ****
  
      <informalexample>
       <programlisting>
! $foo = "0"; // $foo is a string (ASCII 48)
  $foo++; // $foo is the string "1" (ASCII 49)
  $foo += 1; // $foo is now an integer (2)
  $foo = $foo + 1.3; // $foo is now a double (3.3)
! $foo = 5 + "10 Little Piggies"; // $foo is a integer (15)
! $foo = 5 + "10 Small Pigs"; // $foo is an integer (15)
       </programlisting>
      </informalexample>
  
      <simpara>
       If the last two examples above seem odd, see <link
! linkend="lang-syntax.stringconv">String conversion</link>.
!
      <simpara>
       If you wish to force a variable to be evaluated as a certain
       type, see the section on <link
--- 523,540 ----
  
      <informalexample>
       <programlisting>
! $foo = "0"; // $foo is string (ASCII 48)
  $foo++; // $foo is the string "1" (ASCII 49)
  $foo += 1; // $foo is now an integer (2)
  $foo = $foo + 1.3; // $foo is now a double (3.3)
! $foo = 5 + "10 Little Piggies"; // $foo is integer (15)
! $foo = 5 + "10 Small Pigs"; // $foo is integer (15)
       </programlisting>
      </informalexample>
  
      <simpara>
       If the last two examples above seem odd, see <link
! linkend="lang-syntax.stringconv">String conversion</link>.
      <simpara>
       If you wish to force a variable to be evaluated as a certain
       type, see the section on <link
***************
*** 615,631 ****
  
       <informalexample>
        <programlisting>
! $foo = 1 + "10.5"; // $foo is a double (11.5)
! $foo = 1 + "-1.3e3"; // $foo is a double (-1299)
! $foo = 1 + "bob-1.3e3"; // $foo is an integer (1)
! $foo = 1 + "bob3"; // $foo is an integer (1)
! $foo = 1 + "10 Small Pigs"; // $foo is an integer (11)
! $foo = 1 + "10 Little Piggies"; // $foo is an integer (11);
! // the string contains 'e'
        </programlisting>
       </informalexample>
  
       <simpara>
        For more information on this conversion, see the Unix manual
        page for strtod(3).
  
--- 614,635 ----
  
       <informalexample>
        <programlisting>
! $foo = 1 + "10.5"; // $foo is double (11.5)
! $foo = 1 + "-1.3e3"; // $foo is double (-1299)
! $foo = 1 + "bob-1.3e3"; // $foo is integer (1)
! $foo = 1 + "bob3"; // $foo is integer (1)
! $foo = 1 + "10 Small Pigs"; // $foo is integer (11)
! $foo = 1 + "10 Little Piggies"; // $foo is integer (11);
! $foo = "10.0 pigs " + 1; // $foo is int (11)
! $foo = "10.0 pigs " + 1.0; // $foo is double (11)
        </programlisting>
       </informalexample>
  
       <simpara>
+ The type of the variable depends on the second not on the first
+ expression, when the first expression is a string.
+
+ <simpara>
        For more information on this conversion, see the Unix manual
        page for strtod(3).
  
***************
*** 634,643 ****
     <title>Array manipulation</title>
  
      <para>
! PHP supports both scalar and associative arrays. In fact, there is no
! difference between the two. You can create an array using the
! <function>list</function> or <function>array</function> functions, or
! you can explicitly set each array element value.
  
      <informalexample>
       <programlisting>
--- 638,647 ----
     <title>Array manipulation</title>
  
      <para>
! PHP supports both scalar and associative arrays. In fact, there
! is no difference between the two. You can create an array using
! the <function>list</function> or <function>array</function>
! functions, or you can explicitly set each array element value.
  
      <informalexample>
       <programlisting>

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>