Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117577 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99524 invoked from network); 23 Apr 2022 10:53:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Apr 2022 10:53:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3858B18037E for ; Sat, 23 Apr 2022 05:27:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,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, T_SCC_BODY_TEXT_LINE 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-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.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 ; Sat, 23 Apr 2022 05:27:56 -0700 (PDT) Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-2ec0bb4b715so109348567b3.5 for ; Sat, 23 Apr 2022 05:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=8JEkNgUYhv8hOce4spCtTuH6IfJ3S33BgUonQn0QBUU=; b=mH+jcTflSIhNwyYsPiR+nHCtGXZu5UUtWFQjmmel4OrBZAycNHLmpTAxFT+1TZpmU7 fSTrL5NMVK1rH2KyQeTX2bDCmrD0oySnqvjUrVVjhr4jnDNtNac9o1PV2BVGkwv4A4r+ /odOiEG5R2l1RlLoIQYLhFvvNYphOnazRMcG3s0n0/7bhpb1JMBPduOKUJhUqgQQSv9h EZGyvkwZoDmRhXpbQOBbIzi3AvaVK+9FeG1EcQ22DM2d6VbDI+dWRM3PH0wJnjHmGnpC t87upEo9HXTPUM4oTdDHlEOIl8XEE62/btIveEjtZY5xpMmLHNHStmv17et1wnUe8E2l fBRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8JEkNgUYhv8hOce4spCtTuH6IfJ3S33BgUonQn0QBUU=; b=dGnvkh+EPzf8uTzTzP9KbjNgQpV7+FDkE23zCCVxb8QoImr/kEF3FbwHztgyEKNTq3 3Gp0K6RnpdpGou5gs3H5voeM9nCC2zwWX3ZFehfKBNLv33LLksmcxwd0CuJYOjLs3T+O LuGJC4pzMQte4eRHRob08z8DB2E66FreNXKQ0Dbr+5d0dQw+MrhCQh+Kw6/N1a821N8e vAVHMCYeOkAagHSmbkmD9rkxMspz4axcflBccrC4xOM9S0+15KzmFea4nv1OvKgAMso0 uDdVQOmgLivUClZZtXF7hEYCiKst2YmEURTLXnFub08+q4eDajnqUUzvTiywd8T5uSdC 5u3w== X-Gm-Message-State: AOAM532l4i4z3pknq574nQwjqZbF9d7NTI9xvHFb75hiq/89PmHClcHr 7fsS0EczgLVKCpakCn5O/8S6FYM7iUyDSNLdSRVmhTyok0s= X-Google-Smtp-Source: ABdhPJxDhg6vVbsZ56EDgTITtgohHCqOySw8fIFpYNGhKm/8KnziYtXQzk5FrgYLcY8ej5VRvEkfT90Q8EjvmEAclKA= X-Received: by 2002:a05:690c:10d:b0:2ef:491d:b522 with SMTP id bd13-20020a05690c010d00b002ef491db522mr9468153ywb.358.1650716875994; Sat, 23 Apr 2022 05:27:55 -0700 (PDT) MIME-Version: 1.0 Date: Sat, 23 Apr 2022 13:27:45 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000004ba0f05dd517960" Subject: Canonicalize "iterable" into "array|Traversable" and Reflection From: george.banyard@gmail.com ("G. P. B.") --00000000000004ba0f05dd517960 Content-Type: text/plain; charset="UTF-8" Hello internals, One area the engine currently needs to take special care is dealing with the typing relation between iterable, Traversable, and array. The change is to canonicalize "iterable" into "array|Traversable" as this then removes this special case. However, doing so breaks Reflection for iterable types and will now return a ReflectionUnionType instead of a ReflectionNamed type. There are a couple of options to proceed: - Accept the BC break, and expect end users to already be handling union types for code running on 8.2 (least complexity) - Only provide a BC layer for (?)iterable to return a ReflectionNamedType and have usages of iterable in a union type be exposed as Traversable|array (OK complexity) - Full BC such that even in union types where iterabl was used Traversable|array gets converted back to iterable (high complexity) The PR for this change is https://github.com/php/php-src/pull/7309 This PR is also blocking the implementation for DNF types, as it vastly simplifies the implementation of it. Best regards, George P. Banyard --00000000000004ba0f05dd517960--