Re: RFC: short and inner classes

From: Date: Thu, 06 Mar 2025 08:04:55 +0000
Subject: 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
Hi

Am 2025-03-06 07:23, schrieb Rob Landers:
So, technically, they aren’t required to be in the same RFC; but also, they complement each other very well.
They really should be separate RFCs then. Your RFC text acknowledges that in the very first sentence: “two significant enhancements to the language”. Each individual proposal likely has sufficient bike-shedding potential on its own and discussion will likely get messy, because one needs to closely follow which of the two proposals an argument relates to. --------- I've also given your RFC a first pass, without yet trying to understand all the implications. Here's some comments. As for the “Short classes” proposal: - I don't understand the use of private properties. Given that the classes cannot have methods, they would be inaccessible, no? As for the “Inner classes” proposal: - “abstract is not allowed as an inner class cannot be parent classes.” - Why? - “type hint” - PHP does not have type hints, types are enforced. You mean “Type declaration”. - “this allows you to redefine an inner class in a subclass, allowing rich hierarchies” - The RFC does not specify if and how this interacts with the LSP checks. Best regards Tim Düsterhus

Thread (102 messages)

« previous php.internals (#126595) next »