Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-24 Thread Rowan Tommins [IMSoP]
On 24 March 2025 09:20:03 GMT, "Alexandru Pătrănescu" wrote: >On Sun, Mar 23, 2025 at 5:20 PM Larry Garfield >wrote: > >> >> So, how would nested classes compare to fileprivate, in terms of ability >> to solve the problem space? As I understand it, the goal is: >> >> 1. Classes that can be i

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-24 Thread Alexandru Pătrănescu
On Sun, Mar 23, 2025 at 5:20 PM Larry Garfield wrote: > > So, how would nested classes compare to fileprivate, in terms of ability > to solve the problem space? As I understand it, the goal is: > > 1. Classes that can be instantiated only by the class that uses them. > 2. But can be returned fro

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-23 Thread Larry Garfield
On Wed, Mar 12, 2025, at 5:10 AM, Rob Landers wrote: > Hello internals, > > I've made some major updates to the text of the RFC to clarify > behaviors and revisited the implementation (which is still under > development, though I hope to have a draft by the end of this weekend). > Here's a broa

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-15 Thread Tim Düsterhus
Hi Am 2025-03-14 01:22, schrieb Bob Weinand: […] class constants in uppercase […] enum cases are a notable Exception. They also use PascalCase (both internal enums and the PER-CS coding style as published by PHP-FIG). But that's also a good question for the RFC author: Is defining inner cl

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-15 Thread Tim Düsterhus
Hi Am 2025-03-13 21:46, schrieb Rob Landers: 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 keyb

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-14 Thread Rob Landers
On Wed, Mar 12, 2025, at 11:10, Rob Landers wrote: > On Thu, Mar 6, 2025, at 00:11, Rob Landers wrote: >> Hello PHP Internals, >> >> I'd like to introduce my RFC for discussion: >> https://wiki.php.net/rfc/short-and-inner-classes >> >> This RFC defines a short class syntax as well as the ability

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Rob Landers
On Thu, Mar 13, 2025, at 23:26, Bob Weinand wrote: > Hey Rob, > > On 13.3.2025 21:46:49, Rob Landers wrote: >> 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

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Bob Weinand
Hey Rob, On 14.3.2025 00:26:03, Rob Landers wrote: My biggest issue with `::` is that it gets weird: class Foo {   public class Bar {}   public const Bar = "";   public static function Bar() {} } echo Foo::Bar; // this is the constant new Foo::Bar(); // this is the class Foo::Bar(); // this is

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Bob Weinand
Hey Rob, On 13.3.2025 21:46:49, Rob Landers wrote: 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

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Rob Landers
On Thu, Mar 13, 2025, at 21:41, Ilija Tovilo wrote: > Hi Rob > > On Thu, Mar 13, 2025 at 1:57 PM Rob Landers wrote: > > > > > the proposal is > > > currently quite complex. > > > > Most of this is just describing how classes work already and going in-depth > > on where there may be confusion --

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Rob Landers
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 suffi

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Ilija Tovilo
Hi Rob On Thu, Mar 13, 2025 at 1:57 PM Rob Landers wrote: > > > the proposal is > > currently quite complex. > > Most of this is just describing how classes work already and going in-depth > on where there may be confusion -- there are no significant changes to how > classes actually work. The

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Rob Landers
On Thu, Mar 13, 2025, at 12:41, Ilija Tovilo wrote: > Hi Rob > > On Thu, Mar 13, 2025 at 12:01 PM Tim Düsterhus wrote: > > > > 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

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Ilija Tovilo
Hi Rob On Thu, Mar 13, 2025 at 12:01 PM Tim Düsterhus wrote: > > 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 suffic

Re: [PHP-DEV] Re: RFC: short and inner classes

2025-03-13 Thread Tim Düsterhus
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