php.net |  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
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: alan dot mckay at gmail dot com
New email:
PHP Version: OS:

 

 [2012-03-27 13:31 UTC] alan dot mckay at gmail dot com
Description:
------------
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-27 19:57 UTC] sixd@php.net
-Status: Open +Status: Feedback
 [2012-03-27 19:57 UTC] sixd@php.net
An actual running testcase would be appreciated so we reproduce EXACTLY what you 
do.
 [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] sixd@php.net
OK.
 [2012-03-27 20:08 UTC] sixd@php.net
-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: Sat Dec 21 15:01:29 2024 UTC