Re: [RFC Proposal] Allow methods to 'become' static

From: Date: Mon, 15 Mar 2021 13:16:18 +0000
Subject: Re: [RFC Proposal] Allow methods to 'become' static
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-113535@lists.php.net to get a copy of this message
On Sun, 14 Mar 2021 at 18:09, Rowan Tommins <rowan.collins@gmail.com> wrote:

> Are you saying that having the parent::getSomeInt() call fail would be
> problematic?
>
>
 Yes, that's where this becomes unsound – you can call the child method
statically, but the parent call assumes a dynamic instance.

This is just my perspective (as someone building a tool that helps prevent
people from shooting themselves in the foot), but PHP should not allow
_more_ unsound behaviour than it already does.

Best wishes,

Matt


Thread (8 messages)

« previous php.internals (#113535) next »