php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #36958 [chm] bug on function.uksort.html
Submitted: 2006-04-03 13:41 UTC Modified: 2006-04-05 08:30 UTC
From: ac_sweeney at yahoo dot co dot uk Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: windows
Private report: No CVE-ID: None
 [2006-04-03 13:41 UTC] ac_sweeney at yahoo dot co dot uk
Description:
------------
I have found a bug on page function.uksort.html
[chm date: 2006-02-09]...


Example 298. uksort() example is wrong the docs state that "The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second"

in the example the "return ($a > $b) ? -1 : 1;" line is wrong as if $a > $b then the statement should be

"return ($a > $b) ? 1 : -1;"



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-03 17:04 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2006-04-04 20:37 UTC] janwb@php.net
Actually, the example was correct, because the output shows the values in descending order. Now, the output is incorrect and should be in ascending order:

3: three
4: four
10: ten
20: twenty

 [2006-04-05 08:30 UTC] vrana@php.net
Thanks for spotting this. So the example was correct and this bug is bogus. However I changed the example to something different than emulation of krsort().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC