Bug #16778 Updated: usort and uasort work only if you give them your array BY REFERENCE.

From: Date: Wed, 24 Apr 2002 00:23:35 +0000
Subject: Bug #16778 Updated: usort and uasort work only if you give them your array BY REFERENCE.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-5755@lists.php.net to get a copy of this message
ID: 16778 Updated by: sniper@php.net Reported By: jeremy@titr.uow.edu.au -Status: Open +Status: Feedback Bug Type: Arrays related Operating System: Linux PHP Version: 4.1.2 New Comment: The proto in PHP 4.2.0 for this function is: bool uasort ( array array, function cmp_function) Which means, that the fuction only returns TRUE or FALSE depending whether it succeeded or not. Please update to PHP 4.2.0 first. --Jani Previous Comments: ------------------------------------------------------------------------ [2002-04-23 20:09:11] jeremy@titr.uow.edu.au The following code doesn't work : $received_array = uasort($send_array,"mycmp") $received_array isn't a correct array (but the integer 1 in general) Where if I do this : $received_array = uasort(&$send_array,"mycmp") $received_array is still not correct, but $send_array has been sorted. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16778&edit=1

« previous php.bugs (#5755) next »