One thought re-reading the RFC.

abstract class Theme {
public function bar();
}

class CuteTheme extends Theme {
public function foo();
}

class Config {
public function __construct(Theme $theme = new CuteTheme()) {}
}

$a = new Config(default->foo());
In the proposed (updated) RFC would this be proposed to work? If so this should 
be added to the discussion section as something I think is equally as 
problematic as union types. I don't think saying "Union and Mixed" is broad 
enough. In this case it would actually have to only allow Theme (whatever that 
was) and prevent you from calling foo() because that isn't a member of Theme . 
Otherwise it's the same problem as union types in a different color.
Coogle
On Aug 29 2024, at 5:52 pm, Bilge <bi...@scriptfusion.com> wrote:
> Hi gang,
>
> On 24/08/2024 17:49, Bilge wrote:
> >
> > New RFC just dropped: https://wiki.php.net/rfc/default_expression. I
> > think some of you might enjoy this one. Hit me with any feedback.
> >
> Now the dust has settled, I've updated the RFC to version 1.1. The
> premise of the RFC is unchanged, but the proposal has been expanded and
> a discussion section added to summarise the ~100 message thread to
> capture the major concerns raised in a condensed format. I hope I've
> done a good job of fairly and accurately representing your concerns, but
> if not please correct me.
>
> Furthermore, a secondary vote has been added. The secondary vote will be
> open to all (whether in favour or against the proposal) to capture
> alternative implementations you might also be in favour of. If the
> primary vote passes, the secondary vote won't matter, but otherwise it
> may help guide our sails in future.
>
> Kind regards,
> Bilge
>

Reply via email to