Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120440 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70885 invoked from network); 29 May 2023 20:29:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 May 2023 20:29:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 94894180544 for ; Mon, 29 May 2023 13:29:12 -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.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 29 May 2023 13:29:12 -0700 (PDT) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-51480d3e161so4741749a12.3 for ; Mon, 29 May 2023 13:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685392150; x=1687984150; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=a7IhfISbByqMIJd3USlxTLGNcT/qJt1D9i7kMLT1EYY=; b=RbGHYFjlblMqLjn6ofglRWM7THZXuG9MX5eLom7fp4fB09FyDNBSIMyIYm++gKYqWP MRhkDD8Fpv8qiXzrVUHtEtp3FVWuRk2c7YcSTzElKJda3jH/iExAqxHqHM9G89mDDxuZ EStMVLUxD1Za9M91KuGXp7kIx/VBGP1O8jp+80jgBbA4saj1ZPR23uNf6dVa5tPP3RdU BA/GzBG9jN05yHc72uQE3ielO4X2p9pCcLO0GMReWLpjMVNJW8swdPLSKTsUJsTRKlQX /2gpF+ryNvCsWueD3z0XBD+XQWKL9Ze7tBa705yd/uBdDIwauZt8tZBPO8NlrtQzJf52 7fLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685392150; x=1687984150; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a7IhfISbByqMIJd3USlxTLGNcT/qJt1D9i7kMLT1EYY=; b=gJnruU+a6Jjpj+yF4KXeKQtOXWKwTko8hMilbngl77+ODJ9oP5/ugJtybPjrMMY8i7 GTL1LU5lGMsIl0BDLBLTqM4b22vPxGOCve18b6lU59GVBNI/RTBshk0AcWcjZYRnzyvb tYsC7GQjq26vebH5VAEhGHaD6NLhyHyQuLqGDcuAhumvv95H2ZmOtPYSAV6USuzXcnku wdSRGU6T7v4uKnrctRpIkiqIHyrwt6LtBv2JtShTZWMDvl1OMWPFfHk+ipW+DNsF7e5T DlknL5RWveOwy6oIPYjGV3nT8c5u7c/v2I1zCgV6KNrhdxveA/gGGNaaHOcxRrIkB6hl uBlw== X-Gm-Message-State: AC+VfDzUrtaAKTgDnGBwFkyWkkerPkVzYKTdXBA5Mf1xgdNxOLHIv63F I/EC6vHu4CfhT98bC2Xuxz1WlhKq5z4= X-Google-Smtp-Source: ACHHUZ4Jt7djFb1eI/zIc5mxQKKM3TRGJVvPmrvLgV5ogPGGI56I42cDbPe2jn8uCH5LIv+7QN+rTg== X-Received: by 2002:a05:6402:1215:b0:514:a244:2915 with SMTP id c21-20020a056402121500b00514a2442915mr6078edw.1.1685392150586; Mon, 29 May 2023 13:29:10 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id w18-20020a50fa92000000b00514ab8bcc30sm462158edr.75.2023.05.29.13.29.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 May 2023 13:29:10 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) In-Reply-To: <641b1ca0-d33f-4f38-ae64-81b4abce24da@app.fastmail.com> Date: Mon, 29 May 2023 22:28:59 +0200 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <51D1B70D-D77A-40A1-8AE5-534E13C67CBB@gmail.com> References: <641b1ca0-d33f-4f38-ae64-81b4abce24da@app.fastmail.com> To: Larry Garfield X-Mailer: Apple Mail (2.3731.600.7) Subject: Re: [PHP-DEV] [RFC] Property hooks, nee accessors From: claude.pache@gmail.com (Claude Pache) > Le 8 mai 2023 =C3=A0 23:38, Larry Garfield a = =C3=A9crit : >=20 > Ilija Tovilo and I would like to offer another RFC for your = consideration. It's been a while in coming, and we've evolved the = design quite a bit just in the last week so if you saw an earlier draft = of it in the past few months, I would encourage you to read it over = again to make sure we're all on the same page. I'm actually pretty = happy with where it ended up, even if it's not the original design. = This approach eliminates several hard-to-implement edge cases while = still providing a lot of functionality in one package. >=20 > https://wiki.php.net/rfc/property-hooks >=20 Hi, If I understand correctly, given: $field; set =3D> $field =3D $value; } public float $someFloatWithHook { get =3D> $field; set =3D> $field =3D $value; } } ?> we have: someInt =3D 42.0); // int(42) var_dump($obj->someFloat =3D 42); // float(42) ?> but: someIntWithHook =3D 42.0); // float(42) var_dump($obj->someFloatWithHook =3D 42); // int(42) ?> If I am correct, it means that the =E2=80=9CThis also implies that = adding a set hook to a property cannot change the result of the =3D = operator=E2=80=9D statement is a bit too optimistic. =E2=80=94Claude