On 08/06/2026 16:36, Alex Rock wrote:
Recently, we had proposals for "Friend classes" and "Pure PHP files". These suggestions aren't new at all, but they demonstrate some wish in the PHP ecosystem to make certain changes for PHP to be closer to other programming languages.


I don't think "being closer to other programming languages" is, or should be, an aim of the project. Our aim should be to make PHP as good a language as it can be.

That includes borrowing ideas which have proved successful in other languages, large and small, as well as avoiding pitfalls which have been revealed by those other languages. It also includes retaining PHP's identity as a distinct language with its own history, user base, and ecosystem.

As I've said in previous discussions, JavaScript's module system was designed around a very specific set of facilities and constraints. It has some similarity to Python, which uses some of the same concepts (e.g. all definitions are essentially anonymous objects, named by assigning to variables).

PHP has an entirely different set of facilities and constraints, much more similar to Java and C# (e.g. all definitions have a globally unique name, namespace imports are primarily short-hand for those unique names).

Your proposal looks very much like trying to wedge JavaScript's solution into PHP, rather than a realistic path forward for PHP's existing ecosystem.


--
Rowan Tommins
[IMSoP]

Reply via email to