[PHP-DOC] cvs: phpdoc /en/reference/array/functions array-unique.xml From: Philip Olson (philip <email protected>)
Date: 02/05/03

philip Wed Feb 5 03:21:22 2003 EDT

  Modified files:
    /phpdoc/en/reference/array/functions array-unique.xml
  Log:
  Fixing examples which almost closes bug #21920. Also, removing old 4.0.4
  warning and some touchups.
  
  
Index: phpdoc/en/reference/array/functions/array-unique.xml
diff -u phpdoc/en/reference/array/functions/array-unique.xml:1.4 phpdoc/en/reference/array/functions/array-unique.xml:1.5
--- phpdoc/en/reference/array/functions/array-unique.xml:1.4 Sun May 12 04:19:28 2002
+++ phpdoc/en/reference/array/functions/array-unique.xml Wed Feb 5 03:21:21 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
 <!-- splitted from ./en/functions/array.xml, last change in rev 1.2 -->
   <refentry id="function.array-unique">
    <refnamediv>
@@ -29,41 +29,33 @@
       Two elements are considered equal if and only if
       <literal>(string) $elem1 === (string) $elem2</literal>. In words:
       when the string representation is the same.
- <!-- TODO: example of it... -->
      </simpara>
      <simpara>
       The first element will be used.
      </simpara>
     </note>
- <warning>
- <simpara>
- This was broken in PHP 4.0.4!
- <!-- TODO: when exactly was this broken?... -->
- </simpara>
- </warning>
     <para>
      <example>
       <title><function>array_unique</function> example</title>
       <programlisting role="php">
 <![CDATA[
+<?php
 $input = array ("a" => "green", "red", "b" => "green", "blue", "red");
 $result = array_unique ($input);
 print_r($result);
-]]>
- </programlisting>
- <para>
- This will output:
- <screen role="php">
-<![CDATA[
+
+/* Which outputs:
+
 Array
 (
- [b] => green
+ [a] => green
+ [0] => red
     [1] => blue
- [2] => red
 )
+*/
+?>
 ]]>
- </screen>
- </para>
+ </programlisting>
      </example>
     </para>
     <para>
@@ -71,24 +63,21 @@
       <title><function>array_unique</function> and types</title>
       <programlisting role="php">
 <![CDATA[
+<?php
 $input = array (4,"4","3",4,3,"3");
 $result = array_unique ($input);
 var_dump($result);
-]]>
- </programlisting>
- <para>
- The printout of the program above will be (PHP 4.0.6):
- <screen role="php">
-<![CDATA[
+
+/* Which outputs:
+
 array(2) {
- [3]=>
- int(4)
- [4]=>
- int(3)
+ [0] => int(4)
+ [2] => string(1) "3"
 }
+*/
+?>
 ]]>
- </screen>
- </para>
+ </programlisting>
      </example>
     </para>
    </refsect1>

-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php