Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Robert Landers
On Thu, Mar 21, 2024 at 11:06 PM Rowan Tommins [IMSoP] wrote: > > On 21/03/2024 19:03, Robert Landers wrote: > > I suppose we are taking this from different viewpoints, yours appears > to be more of a philosophical one, whereas mine is more of a practical > one. > > > My main concern is

Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Matthew Brown
> > What's the advantage of a language construct over the following? > > ```php > /** > * @template T of object > * @psalm-assert T $value > * @param class-string $type > */ > function as(mixed $value, string $type): mixed > { > if (! $value instanceof $type) { throw >

Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Rowan Tommins [IMSoP]
On 21/03/2024 19:03, Robert Landers wrote: I suppose we are taking this from different viewpoints, yours appears to be more of a philosophical one, whereas mine is more of a practical one. My main concern is consistency; which is partly philosophical, but does have practical impact - the

Re: [PHP-DEV] [RFC] Release cycle update, take #2

2024-03-21 Thread Morgan
On 2024-03-22 08:19, Jim Winstead wrote: On Thu, Mar 21, 2024, at 10:54 AM, Derick Rethans wrote: The RFC is at https://wiki.php.net/rfc/release_cycle_update Could this RFC also be a good time to clarify what sort of BC changes are actually allowed in major and minor releases, or should we

Re: [PHP-DEV] [RFC] Release cycle update, take #2

2024-03-21 Thread Jim Winstead
On Thu, Mar 21, 2024, at 10:54 AM, Derick Rethans wrote: > Hi! > > On Fri, 10 Nov 2023, Jakub Zelenka wrote: > >> I would like to propose a new process RFC for updates to PHP release >> cycle: >> >> https://wiki.php.net/rfc/release_cycle_update > > I have just published version 0.2 of this

Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Robert Landers
On Thu, Mar 21, 2024 at 7:01 PM Rowan Tommins [IMSoP] wrote: > > On 21/03/2024 15:02, Robert Landers wrote: > > I don't think you are getting what I am saying. > > $a as int|float > > would be an int, float, or thrown exception. > > $a as int|float|null > > would be an int, float, or null. > > >

Re: [PHP-DEV] [RFC] Release cycle update, take #2

2024-03-21 Thread Daniil Gentili
>> I would like to propose a new process RFC for updates to PHP release >> cycle: >> >> https://wiki.php.net/rfc/release_cycle_update I would also like to propose an addition, allowing patch releases to be made outside of the normal release schedule if a major core feature is broken by a fix

[PHP-DEV] [RFC] Release cycle update, take #2

2024-03-21 Thread Derick Rethans
Hi! On Fri, 10 Nov 2023, Jakub Zelenka wrote: > I would like to propose a new process RFC for updates to PHP release > cycle: > > https://wiki.php.net/rfc/release_cycle_update I have just published version 0.2 of this proposal — I am taken this over from Jakub by agreement. I've slightly

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

2024-03-21 Thread Robert Landers
On Thu, Mar 21, 2024 at 5:15 PM Larry Garfield wrote: > > On Thu, Mar 21, 2024, at 9:10 AM, Robert Landers wrote: > > Hello, > > > > I'm a bit confused on inheritance. In the following example of a > > proxy, do I need to be aware of a parent's hook and handle it > > specially? > > > > class Loud

Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Rowan Tommins [IMSoP]
On 21/03/2024 15:02, Robert Landers wrote: I don't think you are getting what I am saying. $a as int|float would be an int, float, or thrown exception. $a as int|float|null would be an int, float, or null. I get what you're saying, but I disagree that it's a good idea. If $a is 'hello',

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

2024-03-21 Thread Larry Garfield
On Thu, Mar 21, 2024, at 9:10 AM, Robert Landers wrote: > Hello, > > I'm a bit confused on inheritance. In the following example of a > proxy, do I need to be aware of a parent's hook and handle it > specially? > > class Loud > { > public string $name { > get { > return

Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Larry Garfield
On Thu, Mar 21, 2024, at 3:02 PM, Robert Landers wrote: > I don't think you are getting what I am saying. > > $a as int|float > > would be an int, float, or thrown exception. > > $a as int|float|null > > would be an int, float, or null. > > Robert Landers > Software Engineer > Utrecht NL Hi Rob.

[PHP-DEV] System Upgrades / Rsync Server Swapover

2024-03-21 Thread Derick Rethans
Hi! TL,DR: 1. I have just pushed a DNS change to use our new rsync server. 2. I have upgraded main.php.net from Debian 10 to 12 3. I have installed all the latest updates on most machines Long Form 1. In the beginning of the year, Deft (formerly Server Central), reached out to us that the

Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Robert Landers
On Thu, Mar 21, 2024 at 12:45 PM Rowan Tommins [IMSoP] wrote: > > On 20/03/2024 23:05, Robert Landers wrote: > > In other > words, I can't think of a case where you'd actually want a Type|null > and you wouldn't have to check for null anyway. > > > It's not about having to check for null; it's

Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Robert Landers
On Thu, Mar 21, 2024 at 12:45 PM Rowan Tommins [IMSoP] wrote: > > On 20/03/2024 23:05, Robert Landers wrote: > > In other > words, I can't think of a case where you'd actually want a Type|null > and you wouldn't have to check for null anyway. > > > It's not about having to check for null; it's

Re: [PHP-DEV] Proposal: AS assertions

2024-03-21 Thread Rowan Tommins [IMSoP]
On 20/03/2024 23:05, Robert Landers wrote: > In other > words, I can't think of a case where you'd actually want a Type|null > and you wouldn't have to check for null anyway. It's not about having to check for null; it's about being able to distinguish between "a null value, which was one of

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

2024-03-21 Thread Robert Landers
Hello, I'm a bit confused on inheritance. In the following example of a proxy, do I need to be aware of a parent's hook and handle it specially? class Loud { public string $name { get { return strtoupper($this->name); } } } class LoudProxy extends Loud {