Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-16 Thread Ilija Tovilo
Hi Rowan On Sat, Mar 16, 2024 at 8:23 PM Rowan Tommins [IMSoP] wrote: > > I still think there will be a lot of users coming from other languages, or > from using __get and __set, who will look at virtual properties first. Making > things less surprising for those people seems worth some

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-16 Thread Rowan Tommins [IMSoP]
On 16/03/2024 17:51, Ilija Tovilo wrote: Properties can inherit both storage and hooks from their parent. Hopefully, that helps with the mental model. Of course, in reality it is a bit more complicated due to guards and references. That is a really helpful explanation, thanks; I hadn't

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-16 Thread Ilija Tovilo
Hi Rowan On Sat, Mar 16, 2024 at 9:32 AM Rowan Tommins [IMSoP] wrote: > > On 16 March 2024 00:19:57 GMT, Larry Garfield wrote: > > >Well, reading/writing from within a set/get hook is an obvious use case to > >support. We cannot do cached properties easily otherwise: > > > >public string

[PHP-DEV] XSLTProcessor recursion limit

2024-03-16 Thread Niels Dossche
Hi internals Based on https://bugs.php.net/bug.php?id=71571 I've opened a PR to implement two new properties for XSLTProcessor: maxTemplateDepth and maxTemplateVars. The reasoning behind this is that large templates with lots of recursion and/or variables can bump against the default recursion

Re: [PHP-DEV] Supporting object types in BCMath

2024-03-16 Thread Saki Takamachi
Hi Barney, > I would suggest if you do this only supporting immutable objects, or at least > making immutable the default, the one with with the simpler name, and > reserving the mutable version specifically for when people want to use > mutability. The strings used with bcmath today are

Re: [PHP-DEV] Supporting object types in BCMath

2024-03-16 Thread Barney Laurance
On 16/03/2024 05:22, Saki Takamachi wrote: Yet another idea is to also support immutable objects, like DateTime. e.g. ``` $num1 = new BcNum('1.235'); $num1imm = new BcNumImmutable('1.235'); $num2 = new BcNum('2.001'); $num1result = $num1->add($num2); $num1immResult = $num1imm->add($num2); I

Re: [PHP-DEV] Re: Supporting object types in BCMath

2024-03-16 Thread Saki Takamachi
Hi Niels, > One advantage of a new API is that it could be more efficient than the > current API. > The current API takes input as strings and outputs strings as a result, and > therefore always has to reconstruct the BCMath internal state. > By keeping everything inside an object you could

Re: [PHP-DEV] Re: Supporting object types in BCMath

2024-03-16 Thread Niels Dossche
On 3/16/24 11:24, Saki Takamachi wrote: > Hi, > > After thinking about it, this could be done in userland. I'll try creating a > library myself first. > > Regards. > > Saki Hi Saki One advantage of a new API is that it could be more efficient than the current API. The current API takes

[PHP-DEV] Re: Supporting object types in BCMath

2024-03-16 Thread Saki Takamachi
Hi, After thinking about it, this could be done in userland. I'll try creating a library myself first. Regards. Saki

Re: [PHP-DEV] [RFC[ Property accessor hooks, take 2

2024-03-16 Thread Rowan Tommins [IMSoP]
On 16 March 2024 00:19:57 GMT, Larry Garfield wrote: >Well, reading/writing from within a set/get hook is an obvious use case to >support. We cannot do cached properties easily otherwise: > >public string $expensive { > get => $this->expensive ??= $this->compute(); > set { >if

Re: [PHP-DEV] Re: [PHP-CVS] [php-src] master: Deprecate implicit nullable parameter types (#12959)

2024-03-16 Thread Sebastian Bergmann
Am 14.03.2024 um 15:55 schrieb Matteo Beccati: thanks, I had a quick look in the open issues and didn't find anything. AFAICS, https://github.com/nikic/PHP-Parser/pull/984 has not made it into a release yet. But apart from that there are no open issues on PHPUnit's side.