Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123073 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 1CC5B1A009C for ; Tue, 9 Apr 2024 20:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712695091; bh=aL9OSQoOacE/yhSMoEazr49jlQOSXX9EflIqeLRChsk=; h=References:In-Reply-To:From:Date:Subject:To:From; b=bjkn7uq6/tGDJKJBSmxYBrm6BlU+8/Oj+1aL090KYp2h0dm/anVk9XF3H21MkvnIN 7zH3hNANYypKMPokCA9pjqbfwbjINLsGtiP1sltCg2m9JiMxnmXcrR23wV0B3mOp9+ OlxB90wgOxfQFdqSewVRtGVmuFoi++DHjMtU9LGHcSxw8MhOKieNCHiQDpmLznnpAL V9fL3UqKidPLX8r0dlYDn/qZd4XKpWqs8bzbw60zGd13+2dG1vDzNUUGI74xEqI6B5 zXqXQHoxw+jaD9cijr7rHvsjiDkakBI6RJNrToFGtDaurQRymBszzk9TExu8H8RRGC uWq5D/JOvvlNQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C9F6E1805D0 for ; Tue, 9 Apr 2024 20:38:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-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,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) (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 ; Tue, 9 Apr 2024 20:38:10 +0000 (UTC) Received: by mail-vk1-f182.google.com with SMTP id 71dfb90a1353d-4daa8e622f0so1974647e0c.1 for ; Tue, 09 Apr 2024 13:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712695057; x=1713299857; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aL9OSQoOacE/yhSMoEazr49jlQOSXX9EflIqeLRChsk=; b=ln8bzfZ0V5o7R2ZOeQWYx0c7BhU5RehuHjdF5n4KhhqAvo8BHDtgsqG5/RAwQcoKIx ItGBKJ/15TopbXJNuYicuaAfZcQqVXDo1AOGA0kymmjb07xK8uowKJfsAxj/DUZOI3Ch /9/hHgwaPtvser1/c/vVHV/zJb2qVxuGdVk3dQhTlar9kzFrNrxapynbPOWWZ3+ReB6H K5FduMyUaMgMCy9VQ0LBogTMkLp0aOLLgPatTONXGIZph50j0MwqFDPtMHMqDaAQ/gWN hTpyI3CtQ3iGS77lk3Sx2HJ+eA0m6toYu6XtG2MHo7OZ84+3A4sHDyWE8bGbYixVgZuT 5QEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712695057; x=1713299857; h=content-transfer-encoding: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=aL9OSQoOacE/yhSMoEazr49jlQOSXX9EflIqeLRChsk=; b=eq/+i77BnUwfmi5a33hxXwCe5EzM4q3WHpz0wveXXjDxetdXdeKJkaCxG9ShbolVe1 GXdNsD1skmk1Q/YtGDUKBv1ZxHgw/PgF2zBmTPSu2M/7BOmLKQSKQOQakET3r+MohbWF 4IM/Rd5j2PZMUwgVhnfRQwZSq7wlxw5ZCuPxvERQLdwsxt4EC33JuADUGWifClwfbbtT c5xCIHbzNszE7LthRFINsrrJK3GC7evss1uvqGie2uTCoEfIylSKRvSlZyFrE7m18mb8 Rg4kJRKcJmYFlQ8NmBwK0emTmd6OoMc5sdSG+ALZ389StXFbtDZtEMVa+AX5/peQr1m+ X0gA== X-Gm-Message-State: AOJu0YzenyHt41/VRZXYQ9Jhh8c0/L/d6cBgbS2g1DG1wcOUVSIW8pp4 XjBYHsCkAqTc0meEUxwrBYnzuRU/nWlFG4vwNaE7PCiH5kJbHt4bdvGzKePSrPMljufilnQZydp EtG+bf5+gzZTHUXk/5vnGkENG86USO2G9/oRI5A== X-Google-Smtp-Source: AGHT+IFx8aC90LQgSQ5Y2ptex1BOR4PHvjl6JeSCJThlVlMioWRC8WzP35xr4cIU/lT6an+62Ex2EpGXWGpOtUJz95k= X-Received: by 2002:a05:6122:30aa:b0:4d4:1e99:7c8f with SMTP id cd42-20020a05612230aa00b004d41e997c8fmr1046534vkb.6.1712695057231; Tue, 09 Apr 2024 13:37:37 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <9ff3864e-7fb8-4ad1-bbd7-f8c69567a34d@app.fastmail.com> In-Reply-To: Date: Tue, 9 Apr 2024 22:37:26 +0200 Message-ID: Subject: Re: [PHP-DEV] [RFC][Vote announcement] Property hooks To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Robert On Tue, Apr 9, 2024 at 9:34=E2=80=AFPM Robert Landers wrote: > > On Tue, Apr 9, 2024 at 8:56=E2=80=AFPM Larry Garfield wrote: > > > > The Aviz RFC was put to a vote last year but didn't pass. > > It would be really nice if votes weren't just a yes/no vote, but > yes/needs-more-work/no vote, where needs-more-work and no are > effectively the same in terms of passing the RFC, but needs-more-work > just means there is more to do (either addressing ugly syntax or the > idea is sound, but as it says, it needs more work), and can thus be > simply revoted on after concerns are addressed -- instead of creating > a whole new RFC that needs to pass the "not too similar to other RFCs > rule." The asymmetric visibility RFC did include a poll for no votes. https://wiki.php.net/rfc/asymmetric-visibility#proposed_voting_choices > I got the impression from the Aviz discussions that most people were > against Aviz due to the syntax, not the feature itself. It would be > absolutely tragic if this failed to pass simply because people > expected Aviz here. According to the poll, syntax was one, but not the primary reason for its rejection. The primary reason was that some people don't believe the feature is necessary at all. IIRC, people were arguing that readonly covers 80% of use-cases, because it protects against writes to the property both publicly and privately. I don't agree with this viewpoint, because I think readonly is bad for ergonomics. In fact, we already had an RFC that attempted to fix clone for readonly (https://wiki.php.net/rfc/readonly_amendments) but this fix was not complete (because it's still not possible to pass values from clone to __clone). "Clone with" is another thing needed to fix this, and at this point it just feels like applying more band-aids. For DTOs, I believe value types (i.e. data classes, https://externals.io/message/122845) solve the problem of "spooky actions at a distance" in a cleaner and more ergonomic way. For services and other intentional reference types, readonly often isn't the right choice either, just to make the property not publicly writable. Asymmetric visibility would be a much more fitting choice. Anyway, we didn't include asymmetric visibility in this RFC because: * We wanted to avoid getting rejected by people who fundamentally dislike asymmetric visibility. * We didn't feel it was fair to "sneak" the feature back in through some other RFC, when it was explicitly rejected. Instead, we are planning to re-propose asymmetric visibility once property hooks are merged, as it may become more apparent why it is useful. Ilija