Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108399 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92233 invoked from network); 4 Feb 2020 20:05:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Feb 2020 20:05:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 09B3A180211 for ; Tue, 4 Feb 2020 10:17:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 4 Feb 2020 10:17:53 -0800 (PST) Received: by mail-il1-f182.google.com with SMTP id p8so16686871iln.12 for ; Tue, 04 Feb 2020 10:17:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Ihouts5UVM6l76pSO+v7PWwXJgAg+/uqNXeKDPkBpPw=; b=hYZoDkTTTRVYz1X1XnEEQHUdYOq7JYm+4NSUZ+S7aEFsnZfnJVhhcBC/iY3HNpC23O Vdd+zhju5W09sCyj1xezhZssS07TN6SlH8upw4cB82itvT3iE8RkUg3UCopnCi2twJnI cxE0zOCyKoYevZPX+QqY5UtN+kA2oZu9xZVYTMbV3wJNfkkvE8gcJ7x6dA40Tud8MrSl E3nL3HkoUnQKZs3l8GdcypdB5prPqxNo5pFUhGH0hHTAbHPiiDSQ19/Z/qYKwZtqnEnb pC+EYObaKqLKnvBl1DYMfl7FLktFCvB6L8PNgKzu3Ywj4GYXGWmJRneirDShzedysAll UFbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Ihouts5UVM6l76pSO+v7PWwXJgAg+/uqNXeKDPkBpPw=; b=ffAL6oNpJorHFZyIS32WqTOir65UEnE7Z47qz43SfuByu08fe3mAQtAgbwCAa3dZK9 6vPfcCCku2TM6VVC8D7buiZ0v5F2DPPm3Mp+5aDkVBll7EuII0jXDBXSz+/kOSFWQGIn BFnm5U3bIpasoHKqkj5YHV04G5Lcz1/ixrI7Stq+WV3Eq7SFCckgNskFXnbrNqqeSVq5 6krzbWUJ5t7E5Ez5DsRltx3uzDPINV5fA5roGw2sGyHWqGfx9SxINbOlQeCqiiGOkHul 8lBiElBwKY3LCmkklOHMM8+rKLO+LNNJsZAwV19hqdpzUMd6WFk6CVNuyibrGOZYlBx/ UlEQ== X-Gm-Message-State: APjAAAXPLEbhfqHa3kS5j5mMeDKHwk4MfdUTm6jjJN2oLJsDPIqTeGnT d0T4Hgv88hJybmEVils5yqlG9PejHN2/n+Mo0C/MOw== X-Google-Smtp-Source: APXvYqxb+ybt6DblJNCw8uie9SUsW09czWvuQAiSSYOcniPCaQzwuozzJZurwnDPAnrlq9D6QwWmyAkAplVn5uG7/Ek= X-Received: by 2002:a92:8808:: with SMTP id h8mr20023256ild.253.1580840271166; Tue, 04 Feb 2020 10:17:51 -0800 (PST) MIME-Version: 1.0 References: <861afae0-4568-745f-6615-a252067cc506@aimeos.com> <5f5a4ab3-e609-4324-b056-53f782f1a63b@www.fastmail.com> In-Reply-To: Date: Tue, 4 Feb 2020 18:17:40 +0000 Message-ID: To: php internals Content-Type: multipart/alternative; boundary="000000000000cf3fd0059dc40ea8" Subject: Re: [PHP-DEV] Re: [RFC] "arrayable" pseudo type hint From: rowan.collins@gmail.com (Rowan Tommins) --000000000000cf3fd0059dc40ea8 Content-Type: text/plain; charset="UTF-8" On Tue, 4 Feb 2020 at 18:06, Aimeos | Norbert Sendetzky wrote: > Am 04.02.20 um 18:18 schrieb Larry Garfield: > > The more I think on it, the less I like `arrayable`. PHP arrays are > > a terrible data structure from a type system point of view, with too > > much functionality crammed into one variable type. > > The array internals are outside the scope of this proposal and are not > affected in any way by this proposal. > I think Larry's point was that the flexibility of PHP's array type makes it really hard to pin down whether a given object is "array-like" or not, and which attributes a particular function actually cares about. A general "intersection type" system might be more useful, because then you could require the parts you specifically needed, such as "traversable&ArrayAccess" or "traversable&countable". Regards, -- Rowan Tommins [IMSoP] --000000000000cf3fd0059dc40ea8--