Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117477 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24192 invoked from network); 5 Apr 2022 10:28:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Apr 2022 10:28:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A3E82180510 for ; Tue, 5 Apr 2022 04:58:27 -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.6 required=5.0 tests=BAYES_50,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-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (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, 5 Apr 2022 04:58:27 -0700 (PDT) Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-2eb9412f11dso36985577b3.4 for ; Tue, 05 Apr 2022 04:58:27 -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=5Yegv4gVSHvStjeWDYlvpfQdcuzn2/I+AkTdyleZopY=; b=TgFUFZAGFN0Y+PwFBcb3m4klqRLdWGIxFcMorj+SUc5N0M8qNgRBjcA3rsf0sN/tr1 d+xtW5+MqTpgzls6BPr8LBpoGc0csbhSfrksajIl/giOjt0u9vQFqEZN4DsnuPxpm9lD iXuWdTt6HvK57sXyBYqUyoQpcYS2D3fSuzBzz0KeIBv76bVSlksuhQe2HoZqcsZRlFCo CmUm8XdHFq49HJENQzg5PdYAv3xVUb+2y/J1KTnfC5MrhWzVO+RcgQbcDU+hVrPqkpyp G4cAb9050YtmjMLi7TwZGk42b7agFQmIQIIAav5LRRg+/6cKWCglP+a4uNNO1DpZZo/p M4SA== 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=5Yegv4gVSHvStjeWDYlvpfQdcuzn2/I+AkTdyleZopY=; b=ic0KCTm6XQ0XCcFYb6yW+EbOn30geH4B6BY9rUSQOmMYvoq5wG8YwgxWaB/79t4Gv3 enz6yC1rzyccK2XcmMcWbTHL6jcj2d1VfAWtTbHESiH/6UhhH+wQ8TRQK0bO5Ek7gFIz Jhv16PWdJKBqEuCHO/pi8pzDWwGyUyHxksGrHcUA/iKk81Ow5Os2klwN6Wg6vCee4I9b 6S7BTj2mZDKk0ky0dhaW4zQ/RZSyyfj1rBhFO0XZ70If3KRUTTcfZCJPUkX/CtIik42v 2r8/E4m0F8yUKN+3CYEcDXYeQJ8Kv7V43/ogUcdtbBH9IPitzQw4Tin9KEmDpKu4FznO IDmg== X-Gm-Message-State: AOAM530a9DJhtDMEdQcX40cNnDK9IWwW2in1imGWmYC8OykEtiiDBB4U /eNxsOjUCFFlDmnVAnxZBwzpylneY8yN4+/V92d65pK2q3heMA== X-Google-Smtp-Source: ABdhPJwCxdFCvKmH8aqDrHvTZJlRTG6W+xXojekGhuBwvBdaNRKUAU4E80hTHMVQRpGc/eqL3r6pzhcTgFsCxAKKCcE= X-Received: by 2002:a81:b04a:0:b0:2eb:6919:f27 with SMTP id x10-20020a81b04a000000b002eb69190f27mr2291161ywk.54.1649159906212; Tue, 05 Apr 2022 04:58:26 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 5 Apr 2022 12:58:14 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000633e1f05dbe6f656" Subject: Reflection changes due to allow null + false as standalone types RFC From: george.banyard@gmail.com ("G. P. B.") --000000000000633e1f05dbe6f656 Content-Type: text/plain; charset="UTF-8" Hello internals, During the review of the implementation of the RFC which introduces null and false as standalone types there has been a point raised about the changes made to reflection. [1] The current implementation is what follows the RFC, namely to make false|null return a ReflectionUnionType instead of a ReflectionNamedType. Because of this, I made the rendering of this type union to be false|null instead of ?false. Moreover, the question is if this union type should not be consistent with other types and produce a ReflectionNamedType, and have all of the nullable types move to ReflectionUnionType at the same time. I don't mind either way, but as this was voted part of the RFC I feel this should be discussed by internals to see if changing the Reflection semantics to not align with the RFC is okay. As there are currently the following options: - Keep as the RFC stated with some minor implementation complexity which will be resolved when the Reflection changes are made to all other nullable types. - Ignore the Reflection changes of the RFC and align the union type with the current behaviour - Break BC and change all nullable types to return a ReflectionUnionType (I just added the last option for the sake of completeness, but don't think breaking BC is the way to go here). Best regards, George P. Banyard [1] https://github.com/php/php-src/pull/7546#discussion_r837900447 --000000000000633e1f05dbe6f656--