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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Apr 18 19:01:30 2024 UTC