Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87199 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18768 invoked from network); 16 Jul 2015 13:08:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2015 13:08:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.170 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.223.170 mail-ie0-f170.google.com Received: from [209.85.223.170] ([209.85.223.170:36567] helo=mail-ie0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/10-16799-6ECA7A55 for ; Thu, 16 Jul 2015 09:08:55 -0400 Received: by ieik3 with SMTP id k3so55567780iei.3 for ; Thu, 16 Jul 2015 06:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=j8cpnYivsVU+HFXzBgoohVbyyoIkpaOJevhjuxi/RrU=; b=Jd0M7CuGwRRssYjmFPktYo8KDQwSGAz3q9JmkZYn/W7itcSnhv63x+xZSGpj7F9mLI dDpgYqo+CwV4XMsHk+pM5BjLANii99DoNpK/MVv15tHyR6mPlD6s6jLNPYqdoApf6KCS ivyhbVyfBV+x/ttQC9ZcDVj1T1yjNSd51hHja8i23xdjKZNgb0hny6TXA9HjX0tIe1e4 rKEu5By2M/75+DSTPXzftA9qd7GNjI8ECUI/DxZnqFEK6xaTgQ9C4673+MYsssxhxs2P JdtqXLZV78Qn+lEVxaTgEYo/W1b6FrprEiVJ5o5XQ9noZDimxZm4wJrfHxbbv0EKJBpS Mj6Q== X-Received: by 10.107.133.234 with SMTP id p103mr12622385ioi.85.1437052132206; Thu, 16 Jul 2015 06:08:52 -0700 (PDT) MIME-Version: 1.0 References: <1436967838.8300.16.camel@kuechenschabe> <47DA8928-322C-4869-809F-BABDCA20FFB5@gmail.com> <55A778C7.1040100@gmail.com> <55A789B5.60906@php.net> In-Reply-To: <55A789B5.60906@php.net> Date: Thu, 16 Jul 2015 13:08:42 +0000 Message-ID: To: Michael Wallner , Rowan Collins , PHP Internals Content-Type: multipart/alternative; boundary=001a113ea500dd2d61051afdc526 Subject: Re: [PHP-DEV] Consolidation of Traversable and array operations From: tjerk.meesters@gmail.com (Tjerk Meesters) --001a113ea500dd2d61051afdc526 Content-Type: text/plain; charset=UTF-8 Hi! On Thu, Jul 16, 2015 at 6:39 PM Michael Wallner wrote: > On 16/07/15 11:26, Rowan Collins wrote: > > Benjamin Eberlei wrote on 15/07/2015 21:19: > >> > >> But instanceof and anything related to Reflection or get_class or > >> relevant code will fail on array. > > > > > > Ah, yes, I hadn't thought of reflection type things. I don't think > > instanceof would be a problem, because checking for any class or > > interface other than Traversable would correctly return false; not sure > > if it would make sense for "array() instanceof Traversable" to return > > true or not... > > > > Maybe some pseudotype like callable (e.g. iteratable) makes more sense > then? > I'm okay with a pseudo type. My opinion on the matter at this point is such that I care more about providing an API of sorts to support both kinds of structures, so that any developer can write an extension that can leverage this capability and make this available in user-land. Having array_some() and array_every() support this doesn't have to be documented for all I care, if anything it serves as an example of what can be done. The most immediate feedback I would like is: a) whether it's useful to add as an API, b) a review of the code in `php_traversal.[ch]` > > -- > Regards, > Mike > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a113ea500dd2d61051afdc526--