Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121756 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51735 invoked from network); 22 Nov 2023 13:53:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Nov 2023 13:53:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4281718003F for ; Wed, 22 Nov 2023 05:53:37 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-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,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 22 Nov 2023 05:53:36 -0800 (PST) Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-6ce31c4a653so3837257a34.3 for ; Wed, 22 Nov 2023 05:53:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700661212; x=1701266012; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SUcTWc9+A0dYQDiP27zbIC2Rs5sQbjAbwq5OYbMBM08=; b=Yshr99VY7Ekz2Ki1SrTZmKjI4/Ib4C7mDCW8KWMIX3Zc8oqLGEqSL9Clfv2QjVOtbH fA3IQkCtf6ecDoUKce5dKLjJufS7ffa0lphlqJ3zlVzhE/vOtMiRU/uRFRtUXs1dBYJ8 RwkqYtSagyipzUYeeZnta5PDq/vVqp+0pkaA8cqp/jl8GrnCcI0RHjosNaSJHe6c+WGj TFccpJKZqsCUwhX1IlvWRkmsvz8I5Yl/yyrlCxVYUK56XzUfZMmXobodxexG7+YHfjeF WebQQJ+PN2NCaYDMz9On6v9Q5dyBEKoBu/oxywNtj6IhkbCfiJJD4Q1XZmOOD5psGYWa ArbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700661212; x=1701266012; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SUcTWc9+A0dYQDiP27zbIC2Rs5sQbjAbwq5OYbMBM08=; b=nRJ+Y1X8x4DpZTDfjTE5lvvH5GEWbTMDVGixFm8qVTCCuRs2w64dkszmrfsyfuBFKL 9iC1e1DVekgov2uQkLl2wWHSpa8d5ALVKaX+DB45MIwJmGgNxUDNqNaQKWxG+OmuU82T rtMonIgeECF3pwOMchOPfcRhffq/5830zQAl3gX+l425tgh7MeM5OdXsO3ubrZxpIyUu utewBRWEHI5vDANAaiTkmrFZ6tCrNCCKY9CvLZaBPl9d+DuBo3hgXCKwagBO0Ig47A6Z fV7VC5YNbu4CnR9ZHWMdwA3Bb5krbmhoaccmEPbu5TS6TQ2ww7+TNvVOZwx5dQyNyxXo Ce/w== X-Gm-Message-State: AOJu0Yww3zZIJKabJaldOoXj6rP03KLvpnGHGT7NU4jMyvct0PA/smHx SsXJe/O8pX4e7eQTIFDr9lQmtKkLISHF8/ki4ehWSR2BuWU= X-Google-Smtp-Source: AGHT+IF6WOoeAybC/bnQpPlG2biA7AjC49dj11IZ9vZvS3cZagoHkkTZbU2SLIfnHO3InmcDdlzA7nF+l4QHVL+4zz8= X-Received: by 2002:a05:6870:1f08:b0:1f9:55fb:2ba9 with SMTP id pd8-20020a0568701f0800b001f955fb2ba9mr3070160oab.3.1700661212269; Wed, 22 Nov 2023 05:53:32 -0800 (PST) MIME-Version: 1.0 References: <2b4591c1-f999-49b5-8061-67db816aa0da@gmail.com> <054a1e3e-f860-4596-83a9-9f557c6fd316@gmail.com> <4c5c9209-e797-49f3-84a8-f8c2371b34d1@app.fastmail.com> In-Reply-To: <4c5c9209-e797-49f3-84a8-f8c2371b34d1@app.fastmail.com> Date: Wed, 22 Nov 2023 14:53:21 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: [RFC][Discussion] Harmonise "untyped" and "typed" properties From: landers.robert@gmail.com (Robert Landers) On Tue, Nov 21, 2023 at 12:41=E2=80=AFAM Larry Garfield wrote: > > On Mon, Nov 20, 2023, at 11:08 PM, Rowan Tommins wrote: > > On 16/11/2023 20:41, Rowan Tommins wrote: > >> Hi all, > >> > >> I have finally written up an RFC I have been considering for some > >> time: Harmonise "untyped" and "typed" properties > >> > >> RFC URL: https://wiki.php.net/rfc/mixed_vs_untyped_properties > > > > > > I've revised the RFC; it now proposes to keep the implicit "=3D null" f= or > > untyped properties, although I'm still interested in suggestions for > > other strategies around that. I have also added discussion of variance > > checks (thanks Claude for the tips on that). > > Thanks. It's looking pretty good, and should simplify things considerabl= y. > > > While doing so, I checked Reflection, and am unsure how to proceed. > > Currently ReflectionParameter shows a difference between "function > > foo($bar)" and "function foo(mixed $bar)", even though these are > > analysed as equivalent in inheritance checks. Should ReflectionProperty > > also retain this distinction? Was the possibility discussed when "mixed= " > > was introduced of using a ReflectionType of mixed for both cases? > > I don't recall any discussion of ReflectionType when mixed was added, no. > > My initial gut reaction is that both ReflectionParameter and ReflectionPr= operty should treat "omitted" as "mixed", and just evaluate their type to "= mixed". It is in practice a distinction without meaning, or will be after = this RFC. That said, I also have an itch telling me that there are a few s= mall-but-important edge cases where you would care about the difference bet= ween mixed and none in reflection, and that I'd be the one to run into them= , but I cannot think of what they would be. > > --Larry Garfield > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > Hmmm, > That said, I also have an itch telling me that there are a few small-but-= important edge cases where you would care about the difference between mixe= d and none in reflection, I'd also probably run into them, and the only one I can think of will be moot after this RFC: - `unset($this->var)` to use magic methods instead of the properties in some older proxies Other than that, I can't think of anything, though that isn't really important for reflection... Robert Landers Software Engineer Utrecht NL