#47221 [Ver->Bgs]: no result from array_diff()

From: Date: Tue, 01 Sep 2009 08:10:53 +0000
Subject: #47221 [Ver->Bgs]: no result from array_diff()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-141785@lists.php.net to get a copy of this message
 ID:               47221
 Updated by:       sjoerd@php.net
 Reported By:      sgnutzmann at yahoo dot de
-Status:           Verified
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: win32 only - Windows XP
 PHP Version:      5.2.8
 New Comment:

Duplicate of bug #47643.


Previous Comments:
------------------------------------------------------------------------

[2009-09-01 00:04:33] felipe@php.net

See bug #47643

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

[2009-08-31 16:42:06] sjoerd@php.net

Could reproduce. This code shows the time taken to array_diff two
arrays for the builtin array_diff and for a PHP function fast_array_diff
I wrote.

<?php
$a = $b = array();
for ($i = 0; $i < 10000; $i++) {
	$a[] = "s" . ($i * 102121 % 433061);
	$b[] = "s" . ($i * 102121 % 433003);
}
$start = microtime(true);
$res1 = array_diff($a, $b);
echo "Built-in array_diff duration: ".(microtime(true) - $start)."\n";

include('http://www.gissen.nl/files/fast_array_diff.php');
$start = microtime(true);
$res2 = fast_array_diff($a, $b);
echo "Fast_array_diff duration: ".(microtime(true) - $start)."\n";

sort($res1);
sort($res2);
assert($res1 == $res2);
?>

Output:
Built-in array_diff duration: 11.8710849285
Fast_array_diff duration: 0.254959106445


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

[2009-02-08 13:03:18] jani@php.net

Please don't send me more spam. (never saw that and any direct mails 
to me will be deleted anyway)

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

[2009-01-27 13:55:35] sgnutzmann at yahoo dot de

I just try the latest version 'php-5.2-win32-VC6-x86-latest.msi'
(2009-Jan-27 12:00:00). This version has the same problem as PHP 5.2.8
(no return in 5 minutes from array_diff(), infinite loop?). I sent my
test dataset 'TestData.txt' to jani@php.net.

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

[2009-01-27 12:09:33] sgnutzmann at yahoo dot de

PHP 5.2.6 has the same problem as PHP 5.2.8

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

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/47221

-- 
Edit this bug report at http://bugs.php.net/?id=47221&edit=1



Thread (10 messages)

« previous php.bugs (#141785) next »