Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24836 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96973 invoked by uid 1010); 21 Jul 2006 12:43:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96958 invoked from network); 21 Jul 2006 12:43:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2006 12:43:12 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; domainkeys=good DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 64.233.166.181 py-out-1112.google.com Linux 2.4/2.6 Received: from ([64.233.166.181:49446] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 5D/CB-29121-EDBC0C44 for ; Fri, 21 Jul 2006 08:43:11 -0400 Received: by py-out-1112.google.com with SMTP id x31so134889pye for ; Fri, 21 Jul 2006 05:43:08 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=leYTvp95dF53p1dw12vYpT2V2xaMLBcLoqYcXRDXm7p/jNQN6nPPL2TCw6EQZI8ErNtOxTF8BkoYTBJWmAtqEnWwThUDW8ol36On5BALAz3eWvstodtHECYUYJXdzgi4CZW7R+tHtRAuwdRpf9Ax5lMMCxCJSW1odNP7g0+y984= Received: by 10.35.9.15 with SMTP id m15mr1156449pyi; Fri, 21 Jul 2006 05:43:08 -0700 (PDT) Received: by 10.35.93.18 with HTTP; Fri, 21 Jul 2006 05:43:08 -0700 (PDT) Message-ID: <10845a340607210543lfe173abq2221a1c833c5d9e1@mail.gmail.com> Date: Fri, 21 Jul 2006 13:43:08 +0100 Reply-To: RQuadling@GoogleMail.com To: "Matt W" Cc: internals@lists.php.net In-Reply-To: <014e01c6acbe$680b1bc0$0201a8c0@pc1> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <014e01c6acbe$680b1bc0$0201a8c0@pc1> Subject: Re: [PHP-DEV] [PATCH] array_combine is not binary-key safe From: rquadling@googlemail.com ("Richard Quadling") Hi, There are 46 uses of add_assoc_zval() in the CVS. Many are with fixed length strings for the key. Should the others all be using add_assoc_zval_ex() ? On 21/07/06, Matt W wrote: > Hi, > > I don't know if array_combine() was intentionally made binary-key unsafe, > but it seems wrong and inconsistent since binary keys work everywhere else I > can think of -- including array_flip() and the new array_fill_keys(). And > updating it is a bit of an optimization by eliminating strlen() calls. :-) > > I also changed the error message to be more grammatically-correct and fixed > some typos in the description. > > http://www.realplain.com/php/array_combine_binkey.diff > http://www.realplain.com/php/array_combine_binkey_5_2.diff > > > Thanks, > Matt > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"