Re: [PHP-DEV] Moving a tmpfile()?

2023-05-06 Thread Dan Liebner
> Why move the temporary file when it is already a temporary file, right? If you don't want to have to write the file again with a copy? On Sat, May 6, 2023 at 1:56 PM Hans Krentel wrote: > > > > On Saturday 29 April 2023 09:32:42 (+02:00), Dan Liebner wrote: > > > Are there any inherent

Re: [PHP-DEV] Moving a tmpfile()?

2023-05-06 Thread Hans Krentel via internals
On Saturday 29 April 2023 09:32:42 (+02:00), Dan Liebner wrote: > Are there any inherent problems with moving a file created with tmpfile()? > > In practice, it seems that it can be done and the file will not be deleted > after being moved and the file handle closed. yes, not that it

Re: [PHP-DEV] Limit write access to object function parameters

2023-05-06 Thread Lokrain
Hey there, Looking at how to achieve “readonly input object” now a few things come in my mind: * Write a readonly class in first place, assuming it’s not a class from a package you cannot or don’t want to update * Clone the object * Use a new immutable DTO for data transfer * Use stateless

Re: [PHP-DEV] Final anonymous classes

2023-05-06 Thread Larry Garfield
On Sat, May 6, 2023, at 2:16 AM, Rokas Šleinius wrote: > On Fri, 5 May 2023 at 23:58, Levi Morrison via internals > wrote: >> >> I am not sure about making them final by default. I think it's a more >> consistent language design to allow `new final class()` as you >> originally proposed. Although

[PHP-DEV] Limit write access to object function parameters

2023-05-06 Thread Olle Härstedt
Heyo internalitos, I was thinking of having the possibility to use `readonly` (or any other keyword) to make a function argument behave as if it was a readonly object. class Point { public int $x; public int $y; } function doThing(readonly Point $p) { $p->x

Re: [PHP-DEV] Final anonymous classes

2023-05-06 Thread Rokas Šleinius
On Fri, 5 May 2023 at 23:58, Levi Morrison via internals wrote: > > I am not sure about making them final by default. I think it's a more > consistent language design to allow `new final class()` as you > originally proposed. Although I don't know why anyone would want to > extend anonymous