Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117478 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25764 invoked from network); 5 Apr 2022 10:31:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Apr 2022 10:31:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3AF93180540 for ; Tue, 5 Apr 2022 05:01:06 -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.7 required=5.0 tests=BAYES_05,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-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) (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 05:01:06 -0700 (PDT) Received: by mail-vk1-f178.google.com with SMTP id b81so3942015vkf.1 for ; Tue, 05 Apr 2022 05:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KE35zmVBkxVwmjCpA4JvCB0beWjDdnHorBMUg2vNlXo=; b=mjMfzuPtaqJ5kzI3ZZHdagbmWLKT5qRl4uWh0eh6D7CGCbTTbFpY4b34FGXWjOG0xf XFbf9lQBsTGmApBp2/kBogQsYWbqdrS3PBxBiGvBIdJ5yyfYR05I/D+bqS+iJ8euO/k+ S7+qeJhUErZQ3aXIqMZFqdPc3ONKbRLSOdez96BgpF1A7RUJ/lfSy6fCgx0Umxs8/5yG K22U0l+F/q2eHpiNZVazgjPKHXgh4HNN1BEN7lvnUzuSWYpIr9B4dVF60Xy0ufJkpEx5 6V7idUHHzg7Ej8jVVUIwv0BwJgYlfDCV64izBK+oXP9NgEuEsKvlY1BOdqfqgc2lE97W /Ziw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KE35zmVBkxVwmjCpA4JvCB0beWjDdnHorBMUg2vNlXo=; b=Gg9r+zRlflnttRPKzA1bWUTj9R411GRa05Hx92y7eWD2oBP30sy6/+XcgJasg4eLRd TzjCR50uBCFiI3cqxybsYJQZNCFDm8wtCNRm3DugQqsbCjPh0l4Y41piXOtbQi7a6fOF VDlgok+hp34MZN6Q6JxSGNNr3d65deIIaEku2Sy/5ONweIWDtCF6Dpl3036KvEal7NRs fJUByql2yIWP/srZTIYNIDuUY9C9jOHOL645Uh8q+VdwyGZOcUtuFbpEL2OjH+JUV8YJ UJuGc+otpqGsSxYEqyZDoAv9+2MCdIEfzNNztafCnCt4YALtLGjR28cz8clSJcWb8G4x DIQw== X-Gm-Message-State: AOAM533bmtjFQQvxvMl++alzxIFFu7suVFAlc8vWdszm+4CeRVrWMhEP liw2llT3gI9+eB02b9qhbB4Mor+thCO03BD4ODs= X-Google-Smtp-Source: ABdhPJzf7leW/gHhzxtVgwN0V0QAgNHuWTy/R88LDl02ulxuo8sl9b7AIqEaiXzAlC+DP27E5Z5Who/AB81HwLf4S0s= X-Received: by 2002:a05:6122:d0a:b0:342:e95a:a64e with SMTP id az10-20020a0561220d0a00b00342e95aa64emr1063268vkb.22.1649160065238; Tue, 05 Apr 2022 05:01:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 5 Apr 2022 14:00:53 +0200 Message-ID: To: "G. P. B." Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000ddca3205dbe6fffb" Subject: Re: [PHP-DEV] Reflection changes due to allow null + false as standalone types RFC From: ocramius@gmail.com (Marco Pivetta) --000000000000ddca3205dbe6fffb Content-Type: text/plain; charset="UTF-8" Probably best with consistency? > - Ignore the Reflection changes of the RFC and align the union type with the current behaviour This one, specifically. I'd love to see all nullable types become `ReflectionUnionType(ReflectionNamedType($t), ReflectionNamedType(null))`, but that would be a BC break for later on :-) Marco Pivetta https://twitter.com/Ocramius https://ocramius.github.io/ On Tue, 5 Apr 2022 at 13:58, G. P. B. wrote: > 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 > --000000000000ddca3205dbe6fffb--