Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101657 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10443 invoked from network); 22 Jan 2018 17:16:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jan 2018 17:16:07 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.171 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.128.171 mail-wr0-f171.google.com Received: from [209.85.128.171] ([209.85.128.171:38720] helo=mail-wr0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E8/E8-28995-35C166A5 for ; Mon, 22 Jan 2018 12:16:04 -0500 Received: by mail-wr0-f171.google.com with SMTP id x1so9495470wrb.5 for ; Mon, 22 Jan 2018 09:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=NXIP96UBjml9OzQhh2Us9H0rC4rvYuCls/VxZ1050x8=; b=lMl3iGk5hOo0FgAVMDgn4RawiUI3WUsHxw1a0EnHHKTcEei/mMghPS1JaWH4Gxr7No MOxnGdLtus2AtRnEW4P9DOlHvHsb6zK2QNfzjSjCz4g4+PAkg0NQHgmlPw3Iv3tHsAe8 wY5DaQC6HWlI25ZInkhTqrnLpcAmy4QLWLUb5SaG9NrXomGh7NUnk744uqafI1O4RdUW Lgvcow6sB6ZJSywBxLQDg3b3hQAC991DI9Ngv65aHKf60ldAAkNiUFpRtpo1D0vLGw+x 2eka28awwGKV9hA0JeH+DNRCWnzKbwZE4xANboS3MhtlBJyRlTAA+tHkHUGiFNRu9Lwk ZRrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=NXIP96UBjml9OzQhh2Us9H0rC4rvYuCls/VxZ1050x8=; b=lEsDYZh6T4+kXHvZZebsX8Q9ErU7CE2pR63pj8hqwUX9l/sSBt/WTNW+dfcw+ljA8A KqmbfzIR8Cwjguh7JjO7r+2dmvyClq/8E+oRF0PfrGZ5vUJbYVur5v0xNxq78z0nBwCV Eju8e59N5dl23LMMIm0iIpBdj0Cl/aRSLxM0TK/Z0K5C0+8fTif/+iNV6LzouoEbM8MH yJtCq1m5AkyQfAd0dHqKMB5lXfo/ZECb4B2gwNV+EqsmVITfc5hySrNlbAd4owqd1wV2 8HHX22Z4BYtBbFGctOseZwJkQxlCCWxy9h7wLtiMgwmBWN0eSeAksE5ZfPNm9WjXd0j1 kNLw== X-Gm-Message-State: AKwxytdsow0lriA69z6GNzjQyHyFHkh4PO7A0DTbQH3X0Jj1tPEnco6T 4ukMLN22o8OcnxJCAR2v7qYeGfHFRpyiWpr741c= X-Google-Smtp-Source: AH8x225tSK9Hipo/e5BS1WHJO+E4rxr6Hmod+j4rzYFPkVFzjJSdwoBTUZz8MrAYkCerpbab+BpUMO6X1VDp/8MMGRY= X-Received: by 10.223.143.44 with SMTP id p41mr6879704wrb.125.1516641359863; Mon, 22 Jan 2018 09:15:59 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.28.56.3 with HTTP; Mon, 22 Jan 2018 09:15:59 -0800 (PST) In-Reply-To: <1516624483.18039.11.camel@schlueters.de> References: <1516624483.18039.11.camel@schlueters.de> Date: Mon, 22 Jan 2018 10:15:59 -0700 X-Google-Sender-Auth: LoobXTXUDGH_265u1RDLU6KAyzs Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: Gabriel Caruso , "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] is_countable From: levim@php.net (Levi Morrison) On Mon, Jan 22, 2018 at 5:34 AM, Johannes Schl=C3=BCter wrote: > Hi, > > On So, 2018-01-21 at 18:01 +0000, Gabriel Caruso wrote: >> After that, I like to propose and discuss a new function for PHP 7.x >> (current 7.3): is_countable. >> >> *RFC*: https://wiki.php.net/rfc/is-countable. > > The primary place for this imo should be reflection. You did not provide any justification. As you do so keep in mind a lot of code is going to look like: if (is_countable($arg)) { /* take a different code path, such as pre-allocating storage */ } This is not an easily reflectable thing because it's based on an argument which may not even be an object type. Additionally we have a well-established convention of `is_*` function for types specifically known to the engine as is the case here.