Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24391 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36854 invoked by uid 1010); 15 Jul 2006 12:14:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36839 invoked from network); 15 Jul 2006 12:14:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jul 2006 12:14:40 -0000 X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:36812] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id C1/A5-11992-E2CD8B44 for ; Sat, 15 Jul 2006 08:14:39 -0400 Received: from baumbart.mbo (dslb-084-063-002-216.pools.arcor-ip.net [84.63.2.216]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id 0E0C835C1F0; Sat, 15 Jul 2006 14:14:36 +0200 (CEST) Date: Sat, 15 Jul 2006 14:14:40 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <26705546.20060715141440@marcus-boerger.de> To: Matt W Cc: internals@lists.php.net In-Reply-To: <005b01c6a801$5e71fc80$0201a8c0@pc1> References: <009a01c69848$06f22e80$0201a8c0@pc1> <009f01c69cf9$6b493f30$0201a8c0@pc1> <1772356126.20060701125346@marcus-boerger.de> <008701c6a014$ec07ebd0$0201a8c0@pc1> <56141794.20060706101753@marcus-boerger.de> <00fe01c6a4c7$909ad070$0201a8c0@pc1> <1924756948.20060711203719@marcus-boerger.de> <00a201c6a667$147d5c00$0201a8c0@pc1> <271761716.20060715122437@marcus-boerger.de> <005b01c6a801$5e71fc80$0201a8c0@pc1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] array_fill: Allow an array to specify keys From: helly@php.net (Marcus Boerger) Hello Matt, thanks for the update best regards marcus Saturday, July 15, 2006, 1:25:25 PM, you wrote: > Hi Marcus, > ----- Original Message ----- > From: "Marcus Boerger" >> Hello Matt, >> >> Thursday, July 13, 2006, 12:28:27 PM, you wrote: >> >> There's two ways. First as you mentioned sending them as plain text files. >> And second editing the CVS/Entries file in that directory and adding this >> line: "/array_fill_keys.phpt/0/dummy timestamp//". >> >> However that's for your next patches, i added the function to HEAD and 5.2 >> after experimenting with it and mofifying it a tiny bit. I allow empty >> arrays as that is easier for user code. Also this is inline with the >> ability of array_fill() to specify parameter num as zero. >> >> Best regards, >> Marcus > Thanks for the CVS info and adding the function! > I was just updating the function (and tests) for HEAD when you added it, to > make it consistent with the changes Andrei has been making (inc. to > array_fill yesterday): > http://realplain.com/php/array_fill_keys-1.1.diff > http://realplain.com/php/array_fill_keys-1.1.phpt > Besides using parse_parameters instead of get_parameters_ex, array_fill also > changed the handling of "val" passed by reference -- notice > SEPARATE_ZVAL(val) is now gone compared to 5.2. I also marked it "U"nicode > compatible, and simplified the code for filling the array, following what > Andrei did with array_combine yesterday. > I agree about allowing empty arrays, but I was just making it consistent > with array_fill(), which actually *doesn't* allow parameter "num" as 0: > "Number of elements must be positive" > Just to clarify what I mean, the code I updated only applies to HEAD (to > save Andrei from fixing it ;-)). The 5.2 version is OK I guess (unless you > *want* to "simplify" the array filling loop), other than it being > inconsistent with array_fill as far as returning an empty array. > Thanks again, > Matt > P.S. Oh, no big deal, but in the NEWS file, you put "Mathew W" instead of > "Matt W" or "Matthew W" (2 t's ;-)). And the W is for Wilmas, but the > initial is fine; it doesn't matter to me what's there. Best regards, Marcus