cvs: phpdoc /en/language operators.xml
| From: | Daniel Convissor | Date: | Thu, 02 Apr 2009 23:31:53 +0000 |
| Subject: | cvs: phpdoc /en/language operators.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3647@lists.php.net to get a copy of this message | ||
danielc Thu Apr 2 23:31:53 2009 UTC
Modified files:
/phpdoc/en/language operators.xml
Log:
* Bitwise: move example below list of operators.
http://cvs.php.net/viewvc.cgi/phpdoc/en/language/operators.xml?r1=1.131&r2=1.132&diff_format=u
Index: phpdoc/en/language/operators.xml
diff -u phpdoc/en/language/operators.xml:1.131 phpdoc/en/language/operators.xml:1.132
--- phpdoc/en/language/operators.xml:1.131 Mon Feb 16 15:30:18 2009
+++ phpdoc/en/language/operators.xml Thu Apr 2 23:31:53 2009
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.131 $ -->
+<!-- $Revision: 1.132 $ -->
<chapter xml:id="language.operators" xmlns="http://docbook.org/ns/docbook">
<title>Operators</title>
<simpara>
@@ -380,30 +380,6 @@
strings, the bitwise operator will operate on the characters' ASCII
values.
</simpara>
- <para>
- <informalexample>
- <programlisting role="php">
-<![CDATA[
-<?php
-echo 12 ^ 9; // Outputs '5'
-
-echo "12" ^ "9"; // Outputs the Backspace character (ascii 8)
- // ('1' (ascii 49)) ^ ('9' (ascii 57)) = #8
-
-echo "hallo" ^ "hello"; // Outputs the ascii values #0 #4 #0 #0 #0
- // 'a' ^ 'e' = #4
-
-echo 2 ^ "3"; // Outputs 1
- // 2 ^ ((int)"3") == 1
-
-echo "2" ^ 3; // Outputs 1
- // ((int)"2") ^ 3 == 1
-?>
-]]>
- </programlisting>
- </informalexample>
- </para>
-
<table>
<title>Bitwise Operators</title>
<tgroup cols="3">
@@ -458,6 +434,30 @@
</tbody>
</tgroup>
</table>
+ <para>
+ <example>
+ <title>Bitwise operations on strings</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+echo 12 ^ 9; // Outputs '5'
+
+echo "12" ^ "9"; // Outputs the Backspace character (ascii 8)
+ // ('1' (ascii 49)) ^ ('9' (ascii 57)) = #8
+
+echo "hallo" ^ "hello"; // Outputs the ascii values #0 #4 #0 #0 #0
+ // 'a' ^ 'e' = #4
+
+echo 2 ^ "3"; // Outputs 1
+ // 2 ^ ((int)"3") == 1
+
+echo "2" ^ 3; // Outputs 1
+ // ((int)"2") ^ 3 == 1
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
<warning>
<para>
Don't right shift for more than 32 bits on 32 bits systems. Don't left shift