php.net |  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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-11 18:12 UTC] zeev
that's not a bug, it's a known limitation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 14:01:29 2024 UTC