Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122451 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 E2D721ACEBF for ; Thu, 22 Feb 2024 08:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708590900; bh=6E4IesJHNkf9YhF57MogsmZUqZLnhlxGWEtGu0SH3js=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Dd6M9Uz6X2MXZyHIDgOuZZ5txhOGOtCga4S6vgBpsNyMIHgSMrUEdlPIzpF9U6km5 apinSvySPb0AE1YNSi+7cFmSWYZsodHxtN+6RS31vIkX3i61Lhc5ONmB4tcli7ry0F eJ6pWgJUmyFjzxQaz4ag5p0g6Joxloy5LtQfi6uER1iqrz/8+skQo+tU8WRpzUUXc/ Gkcd6hmI0R3HPhIaZQccmiICYhFW3BrTxFdGLJlXu5RF+U/7f7R+OzJ7CZ3wMjFoid tR82LOt+mayjsJs4vr9PlCS26DY3e59ZurWZIqbHeoV0nBa7UK4sWSA/VhuEPOvDWO 6aP7lBsrtiaqw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DDB8E1801EA for ; Thu, 22 Feb 2024 08:34:59 +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-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (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 ; Thu, 22 Feb 2024 00:34:59 -0800 (PST) Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3bba0ac2e88so377627b6e.0 for ; Thu, 22 Feb 2024 00:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708590893; x=1709195693; 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=3PmxURMLFojLkawqpq3gIwJxDdK+any5NAhObCWUHY4=; b=Lx8gyb3IfBStpZQr9PDYYd/61ea15F9iVyovyyJ4YHp0pLRQLQd3Q+UPezdELNZBzt VRKnQLcVSqZvZmXzlf9bL+3d1a8VO0Qv2ZmaCExaBEgx+NFu4RtwtuBx9052QPHicM11 KYNZ8aKV4UgZclHU1dzhufGusnVbgpelj9gJ5wUwXMnyXrmEN7zyFJzda20x3V8n7lhi B2ddenI4xJkX9p6pkBeoGTj38d88HTnac7/c0OwezQHLZXv5py/TZXeom1f1Yy8QHAU2 Sk7sD+lt5BZEWa76TSoozYG1lmO4s6NC6a0GHNPLboiEOaiKGchQJcFBQplsmQdW8OxU 6qfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708590893; x=1709195693; 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=3PmxURMLFojLkawqpq3gIwJxDdK+any5NAhObCWUHY4=; b=TAKeT1kuW2SuK+iAjeyEGYaAOg/ZqNn0FCtrcBKOdlH0XqUObX1uId5fG62NBy/beU 2wVOxHvsNRppvHRnj8negQI6VlSJMFEMH+nXsaenr2yyVQXUfR3kIwMsfpol1ayClbcf dttnsSpN5EiWZgOw+9jc0nK16rg/i8koQZ+hPzJ4abIoOhQ4d0wMbV80H03ydXgMtDP8 qigv2ExIdaGkrX4R7MPRxa2Jwpc/hYqU+7+i9tRYXwQ+zUhOVfrOwKK+UIdiD4Q7INUL uaUdHLYs9LSadYE0EdwfSMk/AlRmmve3HXjSllaPbpjIDqPqMj9igBabW0RLok2rtWKc FJ5w== X-Gm-Message-State: AOJu0Yw4k6iETctQzkQPow7tCnqMaO98TCcVyEs96RzmCf4zjEzAsjP0 FvePq0oMXl4+fhtXhLhJn0VgEf84f80asI9Jj16HVcQFHhc3i2Tn5IaDCi10Z/LjtsHLcvhLjHf Dtn4dPvR8gpwiZ3A0nQUbb6DfB+U= X-Google-Smtp-Source: AGHT+IH/U5SEkVxNI+96ihtf1xppnmWh0STG1d5em1NPdwTmG2XQYLVohQEoovSzi6bGdykK3rJBTfZyxOPXgbvj4Tk= X-Received: by 2002:a05:6808:1809:b0:3c1:325f:4526 with SMTP id bh9-20020a056808180900b003c1325f4526mr963704oib.21.1708590893370; Thu, 22 Feb 2024 00:34:53 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 22 Feb 2024 09:34:40 +0100 Message-ID: Subject: Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2 To: Larry Garfield Cc: php internals , Marco Pivetta Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: landers.robert@gmail.com (Robert Landers) On Wed, Feb 21, 2024 at 7:59=E2=80=AFPM Larry Garfield wrote: > > Hello again, fine Internalians. > > After much on-again/off-again work, Ilija and I are back with a more poli= shed property access hooks/interface properties RFC. It=E2=80=99s 99% unch= anged from last summer; the PR is now essentially complete and more robust,= and we were able to squish the last remaining edge cases. > > Baring any major changes, we plan to bring this to a vote in mid-March. > > https://wiki.php.net/rfc/property-hooks > > It=E2=80=99s long, but that=E2=80=99s because we=E2=80=99re handling ever= y edge case we could think of. Properties involve dealing with both refere= nces and inheritance, both of which have complex implications. We believe = we=E2=80=99ve identified the most logical handling for all cases, though. > > Note the FAQ question at the end, which explains some design choices. > > There=E2=80=99s one outstanding question, which is slightly painful to as= k: Originally, this RFC was called =E2=80=9Cproperty accessors,=E2=80=9D wh= ich is the terminology used by most languages. During early development, w= hen we had 4 accessors like Swift, we changed the name to =E2=80=9Chooks=E2= =80=9D to better indicate that one was =E2=80=9Chooking into=E2=80=9D the p= roperty lifecycle. However, later refinement brought it back down to 2 ope= rations, get and set. That makes the =E2=80=9Chooks=E2=80=9D name less app= licable, and inconsistent with what other languages call it. > > However, changing it back at this point would be a non-small amount of gr= unt work. There would be no functional changes from doing so, but it=E2=80= =99s lots of renaming things both in the PR and the RFC. We are willing to = do so if the consensus is that it would be beneficial, but want to ask befo= re putting in the effort. > > -- > Larry Garfield > larry@garfieldtech.com This is a reply to Marco (https://externals.io/message/122445#122449) for which I didn't actually receive the email but got an email from the list that I didn't receive the email -- seems like it would have been simpler and more correct to resend the email. That is a bit weird, but whatever. > Given the extensive work of this RFC, it seems pretty obvious that > this syntax will not work, I just don't know why. I feel like the syntax is natural, coming from other languages with this feature. However, I really do appreciate the example Marco gives as it feels very idiomatically PHP with all the getters/setters we are used to writing. It also means a pretty simple "just add a space and downcase" to switch from traditional methods to getters/setters to hooks, which could be really nice.