From:             sgnutzmann at yahoo dot de
Operating system: Windows XP
PHP version:      5.2.8
PHP Bug Type:     Performance problem
Bug description:  no result from array_diff()

Description:
------------
I use the function array_diff() to compare two sorted string-arrays with
numerical keys (array sizes are 76,906 and 433,959, string sizes in all
array elements less than 20 characters). With PHP 5.2.4 the function
returns very fast (just few seconds), with PHP 5.2.8 I kill PHP.exe after
30 minutes(!) without result.

PHP.INI:
memory_limit = 1536M
extension=php_pdo.dll
extension=php_zip.dll
extension=php_pdo_odbc.dll


Reproduce code:
---------------
// $Sales and $Inv read previously from file system
$idSales = array();
foreach ( $Sales as $i => $data )
   $idSales[$i] = '#'.$data[2];
array_multisort ($idSales, $Sales);

$idInv = array();
foreach ( $Inv as $i => $data )
   $idInv[$i] = '#'.$data[1];
array_multisort ($idInv, $Inv);

echo "Start array_diff\n";
$unknown = array_diff ( $idSales, $idInv );
echo "End array_diff\n";


Expected result:
----------------
see description

Actual result:
--------------
no result in 30 minutes

-- 
Edit bug report at http://bugs.php.net/?id=47221&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47221&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47221&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47221&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47221&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47221&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47221&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47221&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47221&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47221&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47221&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47221&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47221&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47221&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47221&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47221&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47221&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47221&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47221&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47221&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47221&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47221&r=mysqlcfg

Reply via email to