ID:               51098
 User updated by:  martinkozak at martinkozak dot net
 Reported By:      martinkozak at martinkozak dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: FreeBSD 8.0
 PHP Version:      5.2.12
 New Comment:

Mistake.


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

[2010-02-20 18:41:48] martinkozak at martinkozak dot net

Description:
------------
array_flip() converts some string values to integers (but some not) in
non-associative array and assigns strange values, not value appropriate
to last occurence.

Reproduce code:
---------------
---
>From manual page: http://www.php.net/function.array-flip#Description
---
<?php
    $foo = array(
        '1',
        '1',
        '2&#836;',
        '2',
        '2',
        '2',
        '3',
    );
    
    var_dump(array_flip($foo));

Expected result:
----------------
array(3) {
  ["1"]=>
  int(1)
  ["2&#836;"]=>
  int(5)
  ["3"]=>
  int(6)
}


Actual result:
--------------
array(4) {
  [1]=>
  int(1)
  ["2&#836;"]=>
  int(2)
  [2]=>
  int(5)
  [3]=>
  int(6)
}



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


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

Reply via email to