Bug #47643 [Com]: array_diff() takes over 3000 times longer than php 5.2.4

[email protected] ("sylvain at jamendo dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=47643&edit=1

 ID:               47643
 Comment by:       sylvain at jamendo dot com
 Reported by:      viper7 at viper-7 dot com
 Summary:          array_diff() takes over 3000 times longer than php
                   5.2.4
 Status:           Assigned
 Type:             Bug
 Package:          Performance problem
 Operating System: *
 PHP Version:      5.*, 6CVS (2009-04-13)
 Assigned To:      felipe

 New Comment:

I would also appreciate a patch, this issue made our servers crash after
a php 5.3 
upgrade :-/

thanks!


Previous Comments:
------------------------------------------------------------------------
[2010-02-17 20:53:53] maarten at talkin dot nl

Why dont you only reset ptr if (behavior & DIFF_ASSOC) ?

------------------------------------------------------------------------
[2010-01-17 12:09:15] emiel dot bruijntjes at copernica dot com

This bug is now open for 10 months. Are you still working on this?

------------------------------------------------------------------------
[2009-07-09 20:38:20] [email protected]

As Dmitry's noted, this is side-effect your fix caused.

------------------------------------------------------------------------
[2009-07-01 15:32:01] [email protected]

The problems occurs because of "bad" patch for bug #42838.

The diff algorithm sorts arrays using qsort and then assumes that they
are sorted correctly. But in case of user compaison function it can't be
guaranteed. Thus in ext/standard/tests/array/bug42838.phpt
key_compare_func() can't sort array correctly because expressions (0 <
'a') and (0 > 'a') both false ('a' is interpreted as a number 0).

It should be fixed in some way

------------------------------------------------------------------------
[2009-06-30 15:22:24] [email protected]

Dmitry, could you have a look? I have no idea why this occurs.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=47643


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=47643&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.