php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5592 uksort() adds NULL data
Submitted: 2000-07-14 13:37 UTC Modified: 2000-07-17 06:31 UTC
From: colin at easydns dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.0 OS: RH6.2
Private report: No CVE-ID: None
 [2000-07-14 13:37 UTC] colin at easydns dot com
In a uksort() function, the definition of the user-compare function is something like:

function compare($a,$b) {
   ...
}

In that compare function, $a and $b have null data appended to them.  For example, put this inside the compare function:

   echo urlencode($a);

and you will get something like:

   keyvalue%00

I can solve this by trim()-ing $a and $b all the time, but I think this is more of a bug that should be fixed internally.

- Colin

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-17 06:31 UTC] stas at cvs dot php dot net
Please try 4.0.1pl2 - it should be already fixed.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 06:00:01 2026 UTC