ID:               41396
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dave at emaildienst dot de
-Status:           Open
+Status:           Feedback
 Bug Type:         Arrays related
 Operating System: Debian Etch
 PHP Version:      5.2.2
 New Comment:

Cannot reproduce. This is what I get:

array(3) {
  [0]=>
  int(2)
  [1]=>
  int(1)
  [2]=>
  int(3)
}
array(3) {
  [2]=>
  int(2)
  [1]=>
  int(1)
  [0]=>
  int(3)
}



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

[2007-05-15 10:46:00] dave at emaildienst dot de

Description:
------------
when doing an array reverse with the "preserve keys" switch, just the 
values should be reversed. in fact it makes no difference if the 
preserve keys switch is true or not.

Reproduce code:
---------------
$array[0] = 3;
$array[1] = 1;
$array[2] = 2;

$firsNewArray=array_reverse($array);
$secondNewArray=array_reverse($array, true);


Expected result:
----------------
$firstNewArray
(
    [2] => 2
    [1] => 1
    [0] => 3
)

$secondNewArray
(
    [0] => 2
    [1] => 1
    [2] => 3
)

Actual result:
--------------
$firstNewArray
(
    [2] => 2
    [1] => 1
    [0] => 3
)

$secondNewArray
(
    [2] => 2
    [1] => 1
    [0] => 3
)


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


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

Reply via email to