php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #42889 typo on php.net/function.array-multisort
Submitted: 2007-10-08 12:43 UTC Modified: 2007-11-21 15:01 UTC
From: daniel dot land at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: XP
Private report: No CVE-ID: None
 [2007-10-08 12:43 UTC] daniel dot land at gmail dot com
Description:
------------
The second example on php.net/function.array-multisort says:

'The second will contain 1, 3, "2", 2, 1 (sorted as numbers, in
descending order).'

Maybe this is a typo because 1,3,2,2,1 is not in descending order, right?

Reproduce code:
---------------
N/A

Expected result:
----------------
The first number in the sequence should be 3 or higher.

Actual result:
--------------
The first number in the sequence is 1.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-08 12:49 UTC] rquadling@php.net
The example is correct. You cannot consider the second array as separate from the first array.

This function is emulating the sorting of columns in a table, so the first column has a higher precedence in controlling the results.


 [2007-10-08 13:13 UTC] bjori@php.net
That example is highly confusing.
Adding a note on what really is going on there would be really useful.
 [2007-11-21 15:01 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.

Example changed to:

<?php
$ar1 = array(10, 100, 100, 0);
$ar2 = array(1, 3, 2, 4);
array_multisort($ar1, $ar2);
?>

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 04:01:32 2024 UTC