Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67718 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59135 invoked from network); 18 Jun 2013 15:07:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jun 2013 15:07:29 -0000 Authentication-Results: pb1.pair.com header.from=theanomaly.is@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=theanomaly.is@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.177 as permitted sender) X-PHP-List-Original-Sender: theanomaly.is@gmail.com X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:43342] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/F3-24847-0B770C15 for ; Tue, 18 Jun 2013 11:07:29 -0400 Received: by mail-wi0-f177.google.com with SMTP id ey16so3329635wid.16 for ; Tue, 18 Jun 2013 08:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZMqEFRmjs9JYWHu66tPiNiH6sblcWHKb7wQ1kxRC5xA=; b=T9jQsEzdu+ix3a9gVSWNI+eMFbsiaZ7ar18nhuQG5zQIIpSP2SbB2Q27M/p3kE21Ea uptB/gIrIP5nI0DKLomb4YZbEmnCrFqivp2/EguywR390JP+fYcKVHfSVmMfBkuaFdHs OUjp96FeXHJ2UCj1CJ7vGj2qe/S0iKZ5sxNbLvnXpACsbD7YwFD5Onghs0WOLl1Lu2wI 8m5/zbIJ+fqwMa0ewh6PE1fBnGub2W353ekVtvKq0aQG+NLhxRWC88d4yJ8uiK+qMCW7 PDtAQxnKL3J/EIYrr46YSVOfzuv253xoikL8oVRlOTAXzhG3ghZxu29xm2MmSj51r1VY enYQ== MIME-Version: 1.0 X-Received: by 10.194.249.129 with SMTP id yu1mr11450289wjc.10.1371568045048; Tue, 18 Jun 2013 08:07:25 -0700 (PDT) Received: by 10.227.156.201 with HTTP; Tue, 18 Jun 2013 08:07:24 -0700 (PDT) In-Reply-To: References: Date: Tue, 18 Jun 2013 11:07:24 -0400 Message-ID: To: Levi Morrison Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c299961c4e3d04df6f1287 Subject: Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion] From: theanomaly.is@gmail.com (Sherif Ramadan) --001a11c299961c4e3d04df6f1287 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Jun 18, 2013 at 10:58 AM, Levi Morrison wrote: > > I'm starting up a thread for discussion on Pull Request 287 >> https://github.com/php/php-src/pull/287 (allowing array keys to be passed >> to the callback function of array_filter through a third optional boolean >> argument). I would like to merge this into master and as discussed on IRC >> it would probably be a good idea to startup a discussion and make sure >> there aren't any objections or clarifications not yet voiced. >> >> The patch has no BC because the third argument is optional and defaults to >> false. Personally, I have always thought it would be a good idea to be >> able >> to get the keys into the array_filter callback since I've stumbled across >> a >> few scenarios where that would have made things easier. >> >> I'm not sure if there are any particular down sides to this option being >> added, but none that I can find. It currently passes all tests in master >> and works as expected. >> >> Thoughts, opinions, objections, concerns? >> >> > It might be considered a BC break, but I really think we should drop the > boolean argument; just have it pass the key as parameter 2 always. > See the discussion on github for that PR https://github.com/php/php-src/pull/287#issuecomment-14175109 unfortunately we can't do that as it will break lots of userspace code that might be doing stuff like array_filter(['foo','','bar'], 'strlen') where strlen only accepts a single argument and in those cases the result will be triggering lots of warnings and failed code. --001a11c299961c4e3d04df6f1287--