|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61528 sort function crashes
Submitted: 2012-03-27 13:31 UTC Modified: 2013-02-18 00:35 UTC
From: alan dot mckay at gmail dot com Assigned:
Status: No Feedback Package: Arrays related
PHP Version: Irrelevant OS: Ubuntu 11.11
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-03-27 13:31 UTC] alan dot mckay at gmail dot com
I am using the version of PHP from Ubuntu 11.11 and have the following array 
which causes sort to crash.  The output below was produced with print_r just 
before the call to the sort.

Sorry I cannot upgrade because there is no newer version available yet for ubuntu 
if I do 'apt-get upgrade'  

I do this call : sort($array, SORT_STRING);

If I change it to this, it works :

usort($array, strcasecmp);

Version 5.3.6-13ubuntu3.5

Test script:
    [0] => SeqFeature Object
            [fType] => origin of replication
            [fValue] => F1
            [fStart] => 138
            [fEnd] => 444
            [fDir] => reverse                [fDescr] =>
            [description] =>                [isFeature] => 1
            [featureID] => -1
            [pName] =>                [pAlias] =>
            [pDescr] =>
            [pCategory] =>                [pValue] =>
            [propID] =>            )

    [1] => SeqFeature Object
            [fType] => origin of replication
            [fValue] => pUC
            [fStart] => 1231
            [fEnd] => 1850
            [fDir] => reverse
            [fDescr] =>
            [description] =>
            [isFeature] => 1                [featureID] => -1
            [pName] =>
            [pAlias] =>
            [pDescr] =>
            [pCategory] =>
            [pValue] =>
            [propID] =>


Expected result:
Have the array sorted

Actual result:
Sort never returns


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-27 19:57 UTC]
-Status: Open +Status: Feedback
 [2012-03-27 19:57 UTC]
An actual running testcase would be appreciated so we reproduce EXACTLY what you 
 [2012-03-27 20:03 UTC] alan dot mckay at gmail dot com
I'll see what I can do.  My PHP is pretty rusty - I uncovered this in someone 
else's code and I'm not sure whether or not they are interested in spending time 
on this.   I'll see whether I can load the given array into a tiny best program 
to make it break again.
 [2012-03-27 20:03 UTC] alan dot mckay at gmail dot com
-Status: Feedback +Status: Open
 [2012-03-27 20:08 UTC]
 [2012-03-27 20:08 UTC]
-Status: Open +Status: Feedback
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 05:01:29 2024 UTC