note 102724 added to function.usort

From: Date: Wed, 02 Mar 2011 10:42:09 +0000
Subject: note 102724 added to function.usort
Groups: php.notes 
Request: Send a blank email to php-notes+get-177486@lists.php.net to get a copy of this message
Some contribution towards a specification of usort() ------ - If you don't provide the callback function, an error would be raised: "usort(): Invalid comparison function." - If your callback function doesn't return anything, or returns any value other than -1 or +1 (e.g. 0, 2, -2), then usort() would treat your sorting purpose as if there is no comparison operator provided, and it would actually change your list into an undefined order ------ ---- Server IP: 69.147.83.197 Probable Submitter: 80.113.160.213 ---- Manual Page -- http://www.php.net/manual/en/function.usort.php Edit -- https://master.php.net/note/edit/102724 Del: integrated -- https://master.php.net/note/delete/102724/integrated Del: useless -- https://master.php.net/note/delete/102724/useless Del: bad code -- https://master.php.net/note/delete/102724/bad+code Del: spam -- https://master.php.net/note/delete/102724/spam Del: non-english -- https://master.php.net/note/delete/102724/non-english Del: in docs -- https://master.php.net/note/delete/102724/in+docs Del: other reasons-- https://master.php.net/note/delete/102724 Reject -- https://master.php.net/note/reject/102724 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#177486) next »