betz Tue Apr 6 14:29:54 2004 EDT
Modified files: /phpdoc/en/language expressions.xml Log: user notes integration: four scalar types, comparison retourns boolean some links to operators. nuke PHP/FI http://cvs.php.net/diff.php/phpdoc/en/language/expressions.xml?r1=1.27&r2=1.28&ty=u Index: phpdoc/en/language/expressions.xml diff -u phpdoc/en/language/expressions.xml:1.27 phpdoc/en/language/expressions.xml:1.28 --- phpdoc/en/language/expressions.xml:1.27 Wed Mar 24 11:39:43 2004 +++ phpdoc/en/language/expressions.xml Tue Apr 6 14:29:53 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.27 $ --> +<!-- $Revision: 1.28 $ --> <chapter id="language.expressions"> <title>Expressions</title> <simpara> @@ -49,17 +49,16 @@ </simpara> <simpara> Of course, values in PHP don't have to be integers, and very often - they aren't. PHP supports three scalar value types: integer values, - floating point values and string values (scalar values are values that - you can't 'break' into smaller pieces, unlike arrays, for instance). - PHP also supports two composite (non-scalar) types: arrays and - objects. Each of these value types can be assigned into variables or - returned from functions. + they aren't. PHP supports four scalar value types: <type>integer</type> + values, floating point values (<type>float</type>), <type>string</type> + values and <type>boolean</type> values (scalar values are values that you + can't 'break' into smaller pieces, unlike arrays, for instance). PHP also + supports two composite (non-scalar) types: arrays and objects. Each of + these value types can be assigned into variables or returned from functions. </simpara> <simpara> - So far, users of PHP/FI 2 shouldn't feel any change. However, PHP - takes expressions much further, in the same way many other - languages do. PHP is an expression-oriented language, in the + PHP takes expressions much further, in the same way many other languages + do. PHP is an expression-oriented language, in the sense that almost everything is an expression. Consider the example we've already dealt with, '$a = 5'. It's easy to see that there are two values involved here, the value of the integer @@ -75,10 +74,11 @@ </simpara> <simpara> Another good example of expression orientation is pre- and - post-increment and decrement. Users of PHP/FI 2 and many other + post-increment and decrement. Users of PHP and many other languages may be familiar with the notation of variable++ and - variable--. These are increment and decrement operators. In - PHP/FI 2, the statement '$a++' has no value (is not an + variable--. These are <link linkend="language.operators.increment"> + increment and decrement operators</link>. In + PHP, the statement '$a++' has no value (is not an expression), and thus you can't assign it or use it in any way. PHP enhances the increment/decrement capabilities by making these expressions as well, like in C. In PHP, like in C, there @@ -94,15 +94,15 @@ after reading its value, thus the name 'post-increment'). </simpara> <simpara> - A very common type of expressions are comparison expressions. - These expressions evaluate to either 0 or 1, meaning &false; or &true; - (respectively). PHP supports > (bigger than), >= (bigger than - or equal to), == (equal), != (not equal), < (smaller than) and <= - (smaller than or equal to). The language also supports a set of strict - equivalence operators: === (equal to and same type) and !== (not equal - to or not same type). These expressions are most commonly used - inside conditional execution, such as <literal>if</literal> - statements. + A very common type of expressions are <link + linkend= "language.operators.comparison">comparison</link> + expressions. These expressions evaluate to either &false; or &true;. PHP + supports > (bigger than), >= (bigger than or equal to), == (equal), + != (not equal), < (smaller than) and <= (smaller than or equal to). + The language also supports a set of strict equivalence operators: === + (equal to and same type) and !== (not equal to or not same type). + These expressions are most commonly used inside conditional execution, + such as <literal>if</literal> statements. </simpara> <simpara> The last example of expressions we'll deal with here is combined