php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53468 example 1 for ksort(): match fruit names to index letters
Submitted: 2010-12-03 21:49 UTC Modified: 2010-12-03 21:54 UTC
From: ian at gumstix dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: Irrelevant OS: not applicable
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-12-03 21:49 UTC] ian at gumstix dot com
Description:
------------
---
From manual page: http://www.php.net/function.ksort#Examples
---

The example would be clearer if the first letter of each array value matched the corresponding array key, like so:

$fruits = array("l"=>"lemon", "c"=>"cranberry", "a"=>"apple", "b"=>"banana");

Then, when the output is shown, the reader can easily see that key => value mappings are preserved:

a = apple
b = banana
c = cranberry
l = lemon



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-03 21:54 UTC] danbrown@php.net
-Status: Open +Status: Wont fix
 [2010-12-03 21:54 UTC] danbrown@php.net
There's not enough need for that, and - if anything - could potentially introduce 
more of an issue by using a lower-case 'L' in the example.  It's worked fine for 
years.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 13 15:01:30 2024 UTC