Re: [PHP-DEV] Re: [RFC] Readonly property hooks

2025-07-18 Thread Claude Pache
> Le 19 juil. 2025 à 00:41, Rob Landers a écrit : > > The original author (Nikita) suggested that there's nothing in the original > design that precludes accessors -- and highlights languages where there are > both and they are doing just fine more than 5 years later. Hi Rob, It is indeed e

Re: [PHP-DEV] Re: [RFC] Readonly property hooks

2025-07-18 Thread Eric Norris
Nick, Larry, On Fri, Jul 18, 2025 at 2:01 PM Nicolas Grekas wrote: > > > > Le ven. 18 juil. 2025 à 18:32, Tim Düsterhus a écrit : >> >> Hi >> >> On 7/17/25 18:26, Larry Garfield wrote: >> > Given the lack of consensus both here and in off-list discussions on how >> > to handle get hooks, we hav

[PHP-DEV] RFC creation access wiki.php.net

2025-07-18 Thread Vadim Dvorovenko
wiki.php.net  username: vadimon Please give permissions to create RFC. Planning to create RFC about Pipe Assignment Operator.

Re: [PHP-DEV] Re: [RFC] Readonly property hooks

2025-07-18 Thread Rob Landers
On Fri, Jul 18, 2025, at 21:43, Eric Norris wrote: > Nick, Larry, > > On Fri, Jul 18, 2025 at 2:01 PM Nicolas Grekas > mailto:nicolas.grekas%2b...@gmail.com>> wrote: > > > > > > > > Le ven. 18 juil. 2025 à 18:32, Tim Düsterhus a écrit : > >> > >> Hi > >> > >> On 7/17/25 18:26, Larry Garfield wr

Re: [PHP-DEV] [RFC] Deprecations for PHP 8.5

2025-07-18 Thread Claude Pache
> Le 10 juil. 2025 à 13:18, Gina P. Banyard a écrit : > > On Wednesday, 9 July 2025 at 22:26, Claude Pache > wrote: >> Hi, >> >> A possible reason for wanting to use the non-canonical names in settype(), >> is that those names are returned by gettype(). Fictional example (not >> intended t

[PHP-DEV] PHP 8.3.24RC1 Ready for testing

2025-07-18 Thread Jakub Zelenka
PHP 8.3.24RC1 has just been released and can be downloaded from: https://downloads.php.net/~jakub/ or https://qa.php.net/ or use the git tag: php-8.3.24RC1 Windows binaries are available at: https://windows.php.net/qa/#php-8.3 Please test it carefully, and report any bugs to https://github.co

Re: [PHP-DEV] [RFC] [Discussion] CHIPS

2025-07-18 Thread Claude Pache
> Le 15 juil. 2025 à 12:09, Dmitry Derepko a écrit : > > Hi internals, > > In collaboration with Niels Dossche I'd like to start the discussion for an > RFC proposing a new Cookie option for use with CHIPS technology. > > As Niels noted, today is the day when in 4 weeks there will be code fr

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Faizan Akram Dar
On Fri, 18 Jul 2025, 15:16 Tim Düsterhus, wrote: > Hi > > On 7/9/25 16:05, Larry Garfield wrote: > > 1. `readonly` bills itself as immutability, but it fundamentally is > not. There are at least two loopholes: __get and a mutable object saved to > a property. So while it offering immutability g

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi On 7/18/25 16:25, Faizan Akram Dar wrote: The problem with allowing only set hooks is that readonly class won't be compatible with hooks, I think that is one of the main motivations behind this RFC. Yes. The point is that the semantics users expect from `readonly` are fundamentally incompa

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Marco Pivetta
On Fri, 18 Jul 2025 at 16:43, Tim Düsterhus wrote: > On 7/18/25 16:25, Faizan Akram Dar wrote: > > The problem with allowing only set hooks is that readonly class won't be > > compatible with hooks, I think that is one of the main motivations behind > > this RFC. > > Yes. The point is that the se

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Larry Garfield
On Fri, Jul 18, 2025, at 9:50 AM, Marco Pivetta wrote: > On Fri, 18 Jul 2025 at 16:43, Tim Düsterhus wrote: >> On 7/18/25 16:25, Faizan Akram Dar wrote: >> > The problem with allowing only set hooks is that readonly class won't be >> > compatible with hooks, I think that is one of the main motivat

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi On 7/14/25 15:38, Larry Garfield wrote: Thanks, Ilija. You expressed my concerns as well. And yes, in practice, readonly classes over-reaching is the main use case; if you're marking individual properties readonly, then just don't mark the one that has a hook on it (use aviz if needed) a

Re: [PHP-DEV] Re: [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi On 7/17/25 18:26, Larry Garfield wrote: Given the lack of consensus both here and in off-list discussions on how to handle get hooks, we have done the following: * Split the RFC into two sections, one for get, one for set. * Expanded and refined the examples for both. The implementation is

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Nick
> On 18. Jul 2025, at 23:48, Eric Norris wrote: > > On Fri, Jul 18, 2025 at 12:01 PM Rob Landers > wrote: >> >> >> >> On Fri, Jul 18, 2025, at 17:25, Tim Düsterhus wrote: >> >> Hi >> >> On 7/14/25 15:38, Larry Garfield wrote: >>> Thanks, Ilija. You expressed my c

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread mjec
On Fri, 2025-07-18 at 11:49 -04:00, Rob Landers wrote: > On Fri, Jul 18, 2025, at 17:25, Tim Düsterhus wrote: >> A readonly class is not just a convenience shortcut to mark each >> individual property as readonly. It has important semantics of its own, >> because it forces child classes to also

Re: [PHP-DEV] Re: [RFC] Readonly property hooks

2025-07-18 Thread Nicolas Grekas
Le ven. 18 juil. 2025 à 18:32, Tim Düsterhus a écrit : > Hi > > On 7/17/25 18:26, Larry Garfield wrote: > > Given the lack of consensus both here and in off-list discussions on how > to handle get hooks, we have done the following: > > > > * Split the RFC into two sections, one for get, one for s

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Rob Landers
On Fri, Jul 18, 2025, at 17:25, Tim Düsterhus wrote: > Hi > > On 7/14/25 15:38, Larry Garfield wrote: > > Thanks, Ilija. You expressed my concerns as well. And yes, in practice, > > readonly classes over-reaching is the main use case; if you're marking > > individual properties readonly, the

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Eric Norris
On Fri, Jul 18, 2025 at 12:01 PM Rob Landers wrote: > > > > On Fri, Jul 18, 2025, at 17:25, Tim Düsterhus wrote: > > Hi > > On 7/14/25 15:38, Larry Garfield wrote: > > Thanks, Ilija. You expressed my concerns as well. And yes, in practice, > > readonly classes over-reaching is the main use case

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Rob Landers
On Fri, Jul 18, 2025, at 18:48, Eric Norris wrote: > On Fri, Jul 18, 2025 at 12:01 PM Rob Landers wrote: > > > > > > > > On Fri, Jul 18, 2025, at 17:25, Tim Düsterhus wrote: > > > > Hi > > > > On 7/14/25 15:38, Larry Garfield wrote: > > > Thanks, Ilija. You expressed my concerns as well. And y

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi [dropping most of the folks from the Cc list to reduce noise a little] On 7/18/25 19:08, Nick wrote: As mentioned earlier, this is my very first RFC. I am at a point where I am a bit overwhelmed. With an RFC touching core language semantics, you've certainly opted to touch a hot topic. E

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi On 7/18/25 17:49, Rob Landers wrote: Wasn’t that the entire point of readonly classes? Because it was painful to write readonly for every property. It was certainly *one point*, but not the *entire* point. Quoting from the RFC (https://wiki.php.net/rfc/readonly_classes): "it's still not

Re: [PHP-DEV][RFC] Deprecate type juggling to and from bool type within the function type juggling context

2025-07-18 Thread Gina P. Banyard
On Monday, 2 June 2025 at 17:11, Gina P. Banyard wrote: > Hello internals, > > This is the first RFC out of a set of type system related RFCs I want to > propose for PHP 8.5. > It also used the recently enabled Markdown support on the wiki, so there > might be a few oddities. > > The RFC prop

Re: [PHP-DEV] [RFC] Warnings for PHP 8.5

2025-07-18 Thread Gina P. Banyard
On Tuesday, 15 July 2025 at 18:16, Nicolas Grekas wrote: > Hi Gina, > > Le lun. 14 juil. 2025 à 18:22, Gina P. Banyard a écrit : > >> Hello internals, >> >> Similar to the mass deprecation RFC, I would like to propose the addition of >> a few warnings in certain situations: >> https://wiki.php

Re: [PHP-DEV] [RFC] Warnings for PHP 8.5

2025-07-18 Thread Gina P. Banyard
On Tuesday, 15 July 2025 at 20:42, Rob Landers wrote: > Hi Gina, I feel like destructuring `null` should not be the same warning as > other types since null auto-vivicates? to [] (an empty array). Instead, it > should provide the same warning as https://3v4l.org/8QPiD. Autovivification is only

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi On 7/10/25 17:34, Larry Garfield wrote: Nick previously suggested having the get-hook's first return value cached; it would still be subsequently called, so any side effects would still happen (though I don't know why you'd want side effects), but only the first returned value would ever g

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi Apologies for the belated reply. I was busy with getting my own implementation wrapped up and the thread was so active that I had troubles keeping up. On 7/11/25 06:20, Nick wrote: Personally, I would really like to have `get` hooks on readonly properties. Please consider something like

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi On 7/9/25 19:58, Claude Pache wrote: I hear you, but I still struggle to fully grasp the issue. It’s genuinely hard for me to come up with a real-world example that actually makes sense. Everything I’ve seen so far, including the RFC example and what I tried myself (I gave it an honest shot

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi On 7/9/25 16:05, Larry Garfield wrote: 1. `readonly` bills itself as immutability, but it fundamentally is not. There are at least two loopholes: __get and a mutable object saved to a property. So while it offering immutability guarantees is nice in theory, it's simply not true in practi

Re: [PHP-DEV] [RFC] Readonly property hooks

2025-07-18 Thread Tim Düsterhus
Hi see also my previous reply to your email where you initially mentioned init hooks. On 7/9/25 19:11, Larry Garfield wrote: Can an init hook reference itself, the way get and set can? If the init hook references its own property you will get endless recursion. If there is both an init an

Re: [PHP-DEV] Re: [RFC] Readonly property hooks

2025-07-18 Thread Larry Garfield
On Fri, Jul 18, 2025, at 11:29 AM, Tim Düsterhus wrote: >> // New code in 8.5: >> >> $p = new PositivePoint(3, 4); >> $p2 = clone($p, ['x' => -10]); > > This is not legal code in PHP 8.5. Clone-with respects visibility and > since your asymmetric visibility RFC included the change, you are > p