|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-03-29 06:12 UTC] stas@php.net
[2001-04-28 15:38 UTC] derick@php.net
[2001-04-28 17:17 UTC] busterb at mail dot utexas dot edu
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 10:00:02 2025 UTC |
usort, uasort and uksort all fail to sort an array properly every other time they are called, unless the array is reset() after each call. This is a snippet from a class that fails every other time it is called. var $sort_field; function cmp ($a, $b) { return ($a[$this -> sort_field] > $b[$this -> sort_field]); } function sort_records ($sort_field) { $this -> sort_field = $sort_field; uasort ($this -> record_data, array($this, "cmp")); }