Re: Re: RFC: short and inner classes

From: Date: Thu, 13 Mar 2025 20:46:49 +0000
Subject: Re: Re: RFC: short and inner classes
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message


On Thu, Mar 13, 2025, at 12:01, Tim Düsterhus wrote:
> Hi
> 
> Am 2025-03-12 11:10, schrieb Rob Landers:
> > - Accessing inner classes is done via a new token: ":>" instead of 
> > "::".
> 
> I don't particularly like that. It is “invented syntax” and I don't 
> think that inner classes are sufficiently valuable to dedicate an entire 
> operator to them that could serve a more useful purpose in the future. 
> It also got 4 negative points in the rating back when the namespace 
> separator was decided: https://wiki.php.net/rfc/namespaceseparator
> 
> Would \\ (i.e. two backslashes) work? The outer class for inner 
> classes effectively act as a namespace, so it makes sense to me to use 
> syntax that is similar to namespaces.
> 
> I'll look into the rest when there is a new implementation, since I 
> assume some details will still be clarified and fixed as part of 
> implementing the proposal.
> 
> Best regards
> Tim Düsterhus
> 

I am not particularly attached to the separator. I specifically chose it due to being a mixture of
:: and -> and -: seemed like a bad idea. In other words, an inner class felt natural to use :>
-- however, I have some issues with it myself. Particularly, it is too much like |> and as shown
in the namespace RFC, way too easy to typo. Personally, after using it for a few days, I'd
almost rather go back to :: ...

I will give \\ a try, but it has to be typed quite a bit when referencing inner classes, so keeping
it easy to type is a must. I feel like \\ requires a large movement to type, at least on a qwerty
non-english keyboard. Maybe people using other keyboards can chime in.

> I don't think that inner classes are sufficiently valuable

I'm curious why some people feel this way and why some other people are saying the opposite
(emphatically). I'll nudge the private emails I've received to speak up publicly on the
list as well. But, why do you feel this way?

— Rob


Thread (102 messages)

« previous php.internals (#126741) next »