|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1226 usort, uksort... cmp_function scope
Submitted: 1999-03-11 17:44 UTC Modified: 1999-03-11 18:12 UTC
From: ping at alter dot it Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.5 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ping at alter dot it
New email:
PHP Version: OS:


 [1999-03-11 17:44 UTC] ping at alter dot it
if i use usort, uksort etc within a class method, i cannot
specify the cmp_function as another class method. PHP seems to ignore it, and no sort is done. No error message whatsoever.
the cmp_function has to be present as a function in the calling script.
This prevents me from relegating the sort logic to a well uniquely defined method, and obliges to have a function by that exact name whenewer I want to call that class method.

In practice sorting arrays from within classes is unusable


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-11 18:12 UTC] zeev
that's not a bug, it's a known limitation.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Dec 04 21:03:34 2021 UTC