Re: [PHP-DEV] Feature Discussion |

2025-06-09 Thread Larry Garfield
On Mon, Jun 9, 2025, at 12:34 PM, Dmitry Derepko wrote: > Hello, Internals! > > I've implemented an alpha implementation of the Extension Functions in > PHP. > Basically, it's a syntax sugar of the imperative call of the function > with the passing the object as a first argument, but anyway. > >

[PHP-DEV] Feature Discussion |

2025-06-09 Thread Dmitry Derepko
Hello, Internals! I've implemented an alpha implementation of the Extension Functions in PHP. Basically, it's a syntax sugar of the imperative call of the function with the passing the object as a first argument, but anyway. Here is how it looks like in Kotlin: https://kotlinlang.org/docs/extensi

Re: [PHP-DEV] Allow hooks in `readonly` promoted properties

2025-06-09 Thread Tim Düsterhus
Hi Am 2025-06-05 08:04, schrieb Nick: Semantically once you involved inheritance it isn't that easy. It is allowed to override an “unhooked” property with a hooked property and in the “Readonly Amendments” RFC we already decided that inheriting from a `readonly` class by a non-`readonly` class

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

2025-06-09 Thread Larry Garfield
On Sun, Jun 8, 2025, at 7:17 AM, Volker Dusch wrote: > Hey Larry, > > Couple points from a first read and from trying to run the examples. > > a) From the "ProductFromDB" i get: > >> Fatal error: Uncaught TypeError: LazyProduct::$category::get(): Return value >> must be of type Category, none retu

Re: [PHP-DEV] Allow hooks in `readonly` promoted properties

2025-06-09 Thread Tim Düsterhus
Hi Am 2025-06-04 15:39, schrieb Nick: Your test cases really only scratch the surface of what should be tested. You are basically just verifying that it compiles. In fact you are not even testing that reassigning the property is disallowed, because the test fails due to a visibility error. In

Re: [PHP-DEV] [RFC] Make OPcache a non-optional part of PHP

2025-06-09 Thread Tim Düsterhus
Hi Am 2025-05-26 12:47, schrieb Tim Düsterhus: Arnaud, Ilija and I would like to propose making OPcache a non-optional part of PHP starting with PHP 8.5. Please find the RFC including more details at: https://wiki.php.net/rfc/make_opcache_required Since there was not much of a discussion

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

2025-06-09 Thread Claude Pache
> Le 8 juin 2025 à 06:16, Larry Garfield a écrit : > > As Nick has graciously provided an implementation, we would like to open > discussion on this very small RFC to allow `readonly` on backed properties > even if they have a hook defined. > > https://wiki.php.net/rfc/readonly_hooks > > --