Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67731 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97962 invoked from network); 18 Jun 2013 23:09:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jun 2013 23:09:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=petercowburn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=petercowburn@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: petercowburn@gmail.com X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:47450] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/F0-27508-1C8E0C15 for ; Tue, 18 Jun 2013 19:09:53 -0400 Received: by mail-we0-f176.google.com with SMTP id t56so3824583wes.7 for ; Tue, 18 Jun 2013 16:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=qBFuwZTMa2WzzKWj4DksQ7ZaW0rxdR9XNGmcu8jGOWU=; b=N9DoiS+njvprYeXsvkK0pH3AmWtH7wM1u1idm7qixM2Ju54UBbEAQoLFJQmrjmsufh RzSTfSsYhniKQaT8GTqcumZ6n4OSyZbc5j2pzQByUFKqLEqpZQlndktP6sswtMKqLX/V WnKdcAYAcO6KEK8ii4UG9VzIlOZdw2WPVAAbS6ZjJb0p6GyYBqFcb76F7LplrM9bEy8t bmKYCL2mE41nXKVSJmcq/xeWo0G1Fpv8NYoi8pSG9Hq2v2Zux7L35ZP8UL+JDQ+Esdzc eakZjWqIujmhDxSThCvHNy86MMTkoXzzkvL8VobVoT7gTKs57iewGnrR570IDb/dzN08 oIQg== X-Received: by 10.194.176.71 with SMTP id cg7mr74752wjc.18.1371596990665; Tue, 18 Jun 2013 16:09:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.110.101 with HTTP; Tue, 18 Jun 2013 16:09:09 -0700 (PDT) In-Reply-To: References: Date: Wed, 19 Jun 2013 00:09:09 +0100 Message-ID: To: Sherif Ramadan Cc: Patrick Schaaf , internals , Tjerk Anne Meesters , Levi Morrison Content-Type: multipart/alternative; boundary=089e014937f2675c4604df75cf9f Subject: Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion] From: petercowburn@gmail.com (Peter Cowburn) --089e014937f2675c4604df75cf9f Content-Type: text/plain; charset=ISO-8859-1 On 18 June 2013 23:21, Sherif Ramadan wrote: > Are you saying that it's better to have familiarity over functionality? > > I'm not sure I agree with this premise of we shouldn't provide > better functionality just because it would make all the other poorly > written functions look bad. That's setting a lower bar of standards, isn't > it? > > In this case, I have a strong doubt that the "better functionality" will be used, nor that it is indeed "better" at all. I also much prefer, aesthetically, the _key() API over appending a flags parameter: though that is likely, largely due to the familiarity mentioned earlier. Quite frankly the simpler, more familiar approach looks best to me. Also, please don't put words into my mouth: nowhere did I say, "we shouldn't provide better functionality **just because it would make all the other poorly written functions look bad**" (emphasis mine). I appreciate you having an alternative viewpoint, but try not to see what isn't there. What I *was* saying is that the other functions are there, they do a great job and have been for a long time. Why not make use of that array-function-muscle-memory; put it to our advantage? To swing over to the other side of the fence, I do see that the flags-based approach would "work" just as well in terms of getting the functionality out there. It is something I have thought about adding previously for a number of other functions. The closest being adding PREG_GREP_KEY to preg_grep(), which already has (only) PREG_GREP_INVERT. For that function, a new flag would be the best option. For array_filter(), I'm not convinced at all. --089e014937f2675c4604df75cf9f--