Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49548 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57473 invoked from network); 27 Aug 2010 08:01:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Aug 2010 08:01:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=lonnyk@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lonnyk@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: lonnyk@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:49924] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/00-56752-DE0777C4 for ; Fri, 27 Aug 2010 04:01:49 -0400 Received: by qwb8 with SMTP id 8so2713837qwb.29 for ; Fri, 27 Aug 2010 01:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=J5zd9L7PsJWJDDFWYG7410blFvKxBk3tEYdZoIEWR3I=; b=fFsOxfMFCSUs5w9UHvDS5f4N8muOyG3guEwTwBuif+JpB3PaRCFOfJB/biGY7tLB8H AOl0+7HG6Txkh9qYPc0LvDJ23b284K2uLh4LYA1JPkMfrPJyfI7eGgCjuNs6m5zQyU75 ZH5HkRlmIq/N4kKORBiSAx4/YH1CNq5zfyzRM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=sZAC0Ltxsr5LV/Spa9twcAGEtwLWgj8YzSX8Vf1Y+xAVr3dTtnZWHAc5u/hplG+z1G fXhS/mmylN02GFfEEGiFgkwVYGa0QBU2UnJRwpae9tKbLW3v/nQeHMPMcN+hvz8rqbk2 ApIx0tzj9WEbPXNedKm4/SWzA+QwBkGcbKRHo= MIME-Version: 1.0 Received: by 10.229.89.75 with SMTP id d11mr261032qcm.32.1282896106119; Fri, 27 Aug 2010 01:01:46 -0700 (PDT) Received: by 10.229.17.145 with HTTP; Fri, 27 Aug 2010 01:01:46 -0700 (PDT) Date: Fri, 27 Aug 2010 04:01:46 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001636426e31b06298048ec9862c Subject: Bug #47643 - array_diff slowdown From: lonnyk@gmail.com (Lonny K) --001636426e31b06298048ec9862c Content-Type: text/plain; charset=ISO-8859-1 I wanted to discuss this bug to try to get it resolved. I briefly discussed this over ICQ and had differing opinions then the person I was talking to, so naturally I wanted a bigger audience. Quick summary of what's going on: * 47643 is about array_diff being slow. * This was caused by the patch for 42838 * The problem with 42838 is basically that 0 != '0' * Here is the diff: http://www.lonnylot.com/42838.diff The lines that causes the slowdown are: - while (*ptrs[i] && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) { - ptrs[i]++; + while (*ptr && (0 < (c = diff_data_compare_func(ptrs[0], ptr TSRMLS_CC)))) { + ptr++; } I feel the fix should be reverting 42838 because I feel 42838 wasn't a code issue, but a documentation issue. It is noted in some places that comparing a string to an integer results in the string being changed to 0. That is the issue in 42838 and b/c this is excepted in other places it should be excepted here. The documentation should be updated to say to typecast your comparison to (string) if it is going to be important to your code. --001636426e31b06298048ec9862c--