ID: 14591
Updated by: hholzgra
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Arrays related
Operating System: Linux/Windows
PHP Version: 4.1.0
New Comment:

and the problem is ...?

by returning all zeros you made perfectly clear
that you don't care about the order of elements
in your array ;)



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

[2001-12-18 17:03:19] [EMAIL PROTECTED]

If you call uasort with a function that always returns 0 (elements equal) you get a 
totally screwed array returned.

<?php
function mysort($a, $b)
{
    return 0;
}

$a = array('h', 's', 'i', 'c', 'q', 'm');
var_dump($a);
uasort($a, 'mysort');
var_dump($a);
?>

returns:

array(6) {
  [0]=>
  string(1) "h"
  [1]=>
  string(1) "s"
  [2]=>
  string(1) "i"
  [3]=>
  string(1) "c"
  [4]=>
  string(1) "q"
  [5]=>
  string(1) "m"
}
array(6) {
  [1]=>
  string(1) "s"
  [2]=>
  string(1) "i"
  [3]=>
  string(1) "c"
  [4]=>
  string(1) "q"
  [5]=>
  string(1) "m"
  [0]=>
  string(1) "h"
}


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



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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to