[PHP-DOC] #21920 [Bgs->Fbk]: buggy example From: betz <email protected>
Date: 01/28/03

 ID: 21920
 Updated by: betz <email protected>
 Reported By: corinl <email protected>
-Status: Bogus
+Status: Feedback
 Bug Type: Documentation problem
 PHP Version: 4.3.0
 New Comment:

I get:
php -v
PHP 4.3.0 (cli) (built: Jan 8 2003 16:10:13)
Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies
php test.php
Array
(
    [a] => grün
    [0] => rot
    [1] => blau
}

Friedhelm

Previous Comments:
------------------------------------------------------------------------

[2003-01-28 10:26:38] corinl <email protected>

okay, so as you can the *keys* are different!

------------------------------------------------------------------------

[2003-01-28 10:14:05] andrey <email protected>

 Yes, the output on my machine is this. I use the CLI binary.

c:\apache\php>php-cli a_u.php
Array
(
    [a] => gr?n
    [1] => blau
    [2] => rot
)

c:\apache\php>

Andrey

------------------------------------------------------------------------

[2003-01-28 10:08:33] corinl <email protected>

hi!

yes, the ourput is correct...but the documentation is wrong, bacause it
says the example should output:
Array
(
    [b] => green
    [1] => blue
    [2] => red
)

------------------------------------------------------------------------

[2003-01-28 08:42:21] andrey <email protected>

 Look at the View Source of your browser.
Also when using CLI the output is as it is documented.

------------------------------------------------------------------------

[2003-01-28 07:59:32] corinl <email protected>

http://de.php.net/manual/de/function.array-unique.php

the example:
$input = array ("a" => "grün", "rot", "b" => "grün", "blau", "rot");
$result = array_unique ($input);
print_r($result);

should (and does) print:
Array ( [a] => grün [0] => rot [1] => blau )

and not:
Array
(
    [b] => grün
    [1] => blau
    [2] => rot
)

------------------------------------------------------------------------

-- 
Edit this bug report at http://bugs.php.net/?id=21920&edit=1

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