Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62344 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3522 invoked from network); 21 Aug 2012 14:39:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2012 14:39:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:37808] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/90-00460-3BD93305 for ; Tue, 21 Aug 2012 10:39:47 -0400 Received: by lahl5 with SMTP id l5so4023402lah.29 for ; Tue, 21 Aug 2012 07:39:43 -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=dS6PZYFUk/QMEuXNURQ0S6iyVBa7s1G+b993VOLq4L4=; b=lZ6e9Wxu9QWGJ9InvQcl/MxwQ2XyY3qdkZ1ZpoL7fWs5EQIQ7KLjjiJiFm4TpOR+Xq mn1SMgdr+Czi1L6o+M6X4cXe8gV5RAUAvmUwAQZILoN0YdUE9WsTqmuUQzGEgbBpWnwH JAj2Y4luhVpNp43UbtGeuooXXuktQ3DvH3ulzEc3hCrdPyzEs0olfxwX2SPfXQVCsRAt 8mqOEW8qz6enJULdwWJ8D08IJvdySJUvpc9ijpmQA6Q+tnUaTRpNSh7LhM7xfTXjh7gU mei9EOsK+XA4w4yqLm4RKop3UN5PZI4Gnt6JRLd6ovfCtWr7Sk/hyEEfmlf2AioBcWdw NRgg== MIME-Version: 1.0 Received: by 10.112.88.106 with SMTP id bf10mr7813997lbb.43.1345559983814; Tue, 21 Aug 2012 07:39:43 -0700 (PDT) Received: by 10.112.89.174 with HTTP; Tue, 21 Aug 2012 07:39:43 -0700 (PDT) In-Reply-To: References: <502EB667.1020602@lerdorf.com> Date: Tue, 21 Aug 2012 08:39:43 -0600 Message-ID: To: Yasuo Ohgaki Cc: Tjerk Anne Meesters , Rasmus Schultz , internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] re: removing an item from an array From: morrison.levi@gmail.com (Levi Morrison) On Tue, Aug 21, 2012 at 3:36 AM, Yasuo Ohgaki wrote: > Hi > > 2012/8/21 Tjerk Anne Meesters : >> On Tue, Aug 21, 2012 at 10:31 AM, Rasmus Schultz wrote: >> >>> Thank you, but this isn't really anything like what I had in mind. >>> >>> What I had in mind is more like set-semantics for arrays, e.g. designed to >>> work with sets of distinct values/objects. >>> >>> Since I do not have permission to write on the wiki, I posted an initial >>> draft here: >>> >>> https://gist.github.com/321ad9b4b8c4e1713488 >> >> >> Just an idea, since array_delete() may remove multiple values, I would >> change the return value to (int) and return how many elements were removed >> from the array. > > Int would be better and callable should be accepted like array_walk(). > It's better to have array_delete_recursive(), too. > I updated the page. > > array_add() needs more discussion. > What we should do with array value, accept callable or not, etc. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > I'm against this RFC, but if you are going to even try to add something, please keep it consistent! Don't modify `array_delete` to take a callable, instead make a different function `array_udelete` or something. And keep default $strict values consistent with existing functions that have that parameter.