Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101734 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26303 invoked from network); 30 Jan 2018 18:59:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2018 18:59:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=tendoaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tendoaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.177 as permitted sender) X-PHP-List-Original-Sender: tendoaki@gmail.com X-Host-Fingerprint: 209.85.161.177 mail-yw0-f177.google.com Received: from [209.85.161.177] ([209.85.161.177:46411] helo=mail-yw0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/53-24062-F70C07A5 for ; Tue, 30 Jan 2018 13:59:12 -0500 Received: by mail-yw0-f177.google.com with SMTP id c78so5543778ywb.13 for ; Tue, 30 Jan 2018 10:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Nd9osuMeOy09ym628g2mqQNUqM6RB/8cDtj4n07WfOY=; b=WWCp5J5f8Fh+jiazA6H+FhW0lBPkWk6LBufLaZxQKJb7oQ9MFbhMcEd3Iz371bQqYG 1KylmrMsFuLmdR5Bw2eebSjaxJI7oN8z4a3kcjsUpYI7m7KUPAWHLDAzgkqmKDk0woY3 q42erPNh9sae4hsuxuDmg4A5GL9taMdGZEDkkumbmKgJDVJE97EZmVWla8h/ts/wMy4Y kbyMuqgZmuL8G1pZEtBGPvSXpi/JMIDF7uVCTfGvkc/id02aREHirn5lcyUeEhXdD9Cn v5OFibUZWCbWL5Qd1cA6SY+qd1ko4HG85f+XsoY5+d0m0RiDsNNPu9dueT8qIKROo8pr xZTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Nd9osuMeOy09ym628g2mqQNUqM6RB/8cDtj4n07WfOY=; b=KIVg4eYayFgfjuIZaDT/P2XaeQjDJ1VxR9Zpk6Aw/RfJy8TPspzPu/hpN9m+SWDg5j 2+TZxiWMvEstCCqZDtn66ulDxIzP1xyj79KGhhiLrON/flLZhsqwoV/ZnLR95o8dWkM7 yfo3wVd7GmWsPpfFGHpDWpYc1IESd7BuUy9CWrVVMk58M05pVCpluLE7vtK6WjPGDgNn 0rfsvGUJA6zRlWF3CWM5YJ3kRwfzYxWDf1LexnGwKPAkO88J9TEbtKdX/awh/47lVevw mcifTdvt6PdvHSj8qeJRbfLOB697NxEoDDrFrN293tKkNLOvVwYGPoXMtlEZJyd9QQGp j94g== X-Gm-Message-State: AKwxytcmZiqxuoGT2y5pDOEU3OfHN8dNT7vERc/v+TKqKsuA4orChqdp zdZRmF1eY6kEwOOXD0+LE89BIORHR0pfgAqUva4= X-Google-Smtp-Source: AH8x227sby71yugK9HinUpqhRAnyeEosoeQjmR5t1f4dAR5cvBYBva+TkJCVKr+sd2xA+ngGQnn8mSQmlvs9Y1LwKkk= X-Received: by 10.129.55.209 with SMTP id e200mr20007481ywa.306.1517338748043; Tue, 30 Jan 2018 10:59:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.189.16 with HTTP; Tue, 30 Jan 2018 10:59:07 -0800 (PST) In-Reply-To: <28100667.gh41XH5Xuc@vulcan> References: <4026445.Wp3pesFrPl@vulcan> <28100667.gh41XH5Xuc@vulcan> Date: Tue, 30 Jan 2018 12:59:07 -0600 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="001a1144016c14c50e056402f522" Subject: Re: [PHP-DEV][RFC][DISCUSSION] Collection Inspection From: tendoaki@gmail.com (Michael Morris) --001a1144016c14c50e056402f522 Content-Type: text/plain; charset="UTF-8" On Tue, Jan 30, 2018 at 12:13 PM, Larry Garfield wrote: > On Monday, January 29, 2018 6:46:10 PM CST Michael Morris wrote: > > On Mon, Jan 29, 2018 at 6:16 PM, Larry Garfield > > > > wrote: > > > Really, these functions would be useful only on arrays, period. To > allow > > > them > > > on anything else is just dangerous, and on other iterables there are > > > better, > > > more robust approaches (as discussed elsewhere in this thread). > > > > > > As you've demonstrated they're also quite compact and effective to do > in > > > user- > > > space, so unless there's a massive performance difference of moving > them > > > to C > > > they don't seem all that appropriate to add to the language directly. > > > > > > --Larry Garfield > > > > Didn't you personally raise the issue of hard dependencies doing this > sort > > of functionality creates? Implementable in userland or not, this is > pretty > > low level functionality. > > I don't recall doing so in this thread, but I most likely have on some > other > issue. It's the sort of comment that I would make. :-) > It was during the discussion on the Drupal list on adding runtime assertions, the Inspector class in general. Curiously, no one on that list raised the problem of allowing Inspector to traverse any Traversable. At the time Drupal was PHP 5.4 min, so no generators to consider, and I guess the other implications skipped everyone's mind. Personally I think that's fine, and doesn't need a language-level utility > function to wrap it any further. > > We'll just have to disagree then. After all, roughly half the array_* functions can be user implemented, as can roughly half the string functions (though how to do so is often cryptic to beginners). array_test might not be the best name. Anyone got alternatives other than the one in the abandoned RFC mentioned elsewhere in this thread (Not that that one is bad, but if this is the direction to go some input on what to actually call the thing would be nice.)? --001a1144016c14c50e056402f522--