Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124517 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 C30AC1A00BD for ; Sat, 20 Jul 2024 15:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721490535; bh=R5LzvZwtaGE6O9R/tFhZq2/OaZw4HLi0JPcmua5PTTE=; h=References:In-Reply-To:From:Date:Subject:To:From; b=fPHuLU/fXH6rsKkl0gCsuWWf8k9RRXZImwMyLqQPuxXHzAE1Zyxs8ln/SnbMujaCD wXCq7gwdy5uHLD8W9SMUy8F396WLGZUwKdsh6oWPygvKgwUjegSUI+HkHYapwgsPtR AFs0KDU+Wf7URnTUf9sfGXy2Bnxt8E6oEffaJNUnQ52F5OtKsF/1HnxlpqW3LG2ocg MFyhnccD74zc6OQF8pHrJvdaUEvVPlfzsEqCoFHlHAmYOaNLg917aSHKx6bLgtzu5V eUX1KD3/jsPGW/jD165tRtru0vw/Zb4kpDKlQJNQbCF4fiBvObKWLXjdFyRm1MxHe5 pXWWscvLCgJTg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4ED9B18007B for ; Sat, 20 Jul 2024 15:48:53 +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 autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f175.google.com (mail-vk1-f175.google.com [209.85.221.175]) (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 ; Sat, 20 Jul 2024 15:48:50 +0000 (UTC) Received: by mail-vk1-f175.google.com with SMTP id 71dfb90a1353d-4f50c5769e8so202813e0c.0 for ; Sat, 20 Jul 2024 08:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721490437; x=1722095237; 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=8dVxZZHjCUyuYseAUKVL8WID1nnx7sNb6/gi8LqamNM=; b=lW+T41S2L3HOlpXFUu5GoWGuzYILiPdJ+GTHGeeoFGTBoyETYuwaq9m9aMsybh7rR2 F8OLKngK2+wL6obGjAuZ0kA83Kgc8SyZc6sYeqa2DvaNR2ANGwnKdPNTtlj9lHaQCuzT q7NY/mjG+5ouV0GxG7a8bh3lwNtYcwjLEM4rvkIZF7Lr4bE7rGMSVyiDbGtkzY9kwdCc GISP8RpSBxmwZzverXgq4bf+0ZkeICRuC4/fPM91vGPkCNoSQ6H5aRfKIoxxsfIDHRFM nJJfLFHFQSTLSgXwhxVUtb2qnqygCw5XFTb7ZDg4D8seJzEVU8kMoJ4vVkk2rs6rftKQ gnCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721490437; x=1722095237; 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=8dVxZZHjCUyuYseAUKVL8WID1nnx7sNb6/gi8LqamNM=; b=iLazcQaRJRbdkIjGM1riNE/r2BZBKAK+e08KMPClGegn2cO3dUe1haKD7oClc+fYJv IbrbE0KlljgvzfXslDd5JeD8ad3/znyHjflFlhd90Szvzc8ugvCkjyYHMyumb1L6aqM9 x6vLY0nB/YnAzJK3r0yBv6RvMPCpWOU3rKXBhN0Fwzkk8fRe2MNoyND66gcCkbeyOI0w WLCaSkaUUipWAqXfGxpDIOmeeXlTQoKrPuKZoRNB8IdhizuMYssFl95ctqEJQ2glzhh1 Xd9POa8e6Q6C4O0KOV9y+BMLQjssmo3HGgLr1Sz6gWE5JjxEvqt66DDL24ftTUmzpy41 YGig== X-Gm-Message-State: AOJu0YwBttrAXorgIXG4gsAqgB6F0z0B2+QRNyKn2oRALL7NjNgH0iSd 9W7KZjsWUj9oaJDWovK9rFhT/F4KIlnVd0aiyL2w3lA8JR38kpxq0xrK24dNn9LrsVtuYVxAj4p 6iMdUfcEtX5HbY5uzInHJEXGwbwKEsciN X-Google-Smtp-Source: AGHT+IHzNh4C0V7NvTHbw0gFO1S2QFNI/MRWPqV/9THt04fD88FM1qC/C5/wIGLwqPpBG+DyFNskMyrjDsJFpI353d4= X-Received: by 2002:a05:6122:1d4b:b0:4ef:27e0:3f8c with SMTP id 71dfb90a1353d-4f50d0eed7cmr1623275e0c.0.1721490436106; Sat, 20 Jul 2024 08:47:16 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <0a6a61cd-f203-4dea-a7f8-97e6b885c52d@app.fastmail.com> <284c6693-d9bf-4495-adc1-3cc8d5e54ee5@app.fastmail.com> In-Reply-To: <284c6693-d9bf-4495-adc1-3cc8d5e54ee5@app.fastmail.com> Date: Sat, 20 Jul 2024 17:47:05 +0200 Message-ID: Subject: Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2 To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Rob On Sat, Jul 20, 2024 at 3:47=E2=80=AFPM Rob Landers wro= te: > > On Sat, Jul 20, 2024, at 03:14, Larry Garfield wrote: > > On Wed, May 29, 2024, at 2:15 PM, Larry Garfield wrote: > > > > https://wiki.php.net/rfc/asymmetric-visibility-v2 > > Hi folks. After a side quest to polish off hooks, we're nearly ready to = bring aviz to a vote. > > We've made one change since we last discussed it: Specifically, Ilija re= alized that __set's behavior is already inconsistent, so supporting it for = aviz properties with invisible set would make it even more inconsistent, no= t less. For that reason, we've changed the __set behavior such that a non-= readonly aviz property will not trigger __set. Further details are in the = RFC, but in short, all of the use cases for that behavior now have better a= lternatives, such as property types, hooks, and aviz itself. So there's re= ally no point to falling back to __set in edge cases. > > https://wiki.php.net/rfc/asymmetric-visibility-v2#interaction_with_set_an= d_unset > > Hmm, > > There=E2=80=99s a lot of existing code that relies on this behavior, it= =E2=80=99s pretty much the best way to create proxies without requiring cod= e generation. > > This is a pretty massive breaking change. There was a miscommunication between Larry and me. The change is not to any existing behavior. __get/__set are currently called under two circumstances: * The properties _full_ visibility is not met. * The property was explicitly unset. We're not changing this behavior. Instead, we decided not calling __set for asymmetric visibility, when only the set visibility isn't met. Before making this decision, implicitly implying protected(set) for a readonly property would have led to __set being called (because the scope protection now comes from asymmetric visibility, rather than readonly itself), which would have been a change to the current behavior. So, in short: If only the set visibility isn't met, we're now throwing an error. This is consistent with readonly today, and with get-only hooks. If somebody wants to change this in the future, they can do so without any BC breaks, and most likely should make the behavior consistent across all of these three cases. Ilija