Re: Two-step creation for PHP modules

From: Date: Thu, 11 Jun 2026 00:23:29 +0000
Subject: Re: Two-step creation for PHP modules
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-131199@lists.php.net to get a copy of this message
On 2026-06-11 03:24, Rowan Tommins [IMSoP] wrote:
Take Guzzle, for example; it has 43 source files within a specific namespace root. A handful of those are marked "@internal", and a way for PHP to error if users reference them directly would be useful. Some users end up wanting conflicting versions of Guzzle simultaneously, e.g. in different WordPress plugins; so some way of isolating or rewriting class names (and all their references) would be useful. There are not 43 separate "modules", and the maintainers of Guzzle aren't going to combine all of them into one file. Defining a single package with multiple files is not a stretch goal, it's the only plausible starting point. Just throwing this out, but couldn't the "module file" - the one that users bring into their project and the one that exports what it's declared to export - delegate the definitions of the functions etc. both public and private to other files?
I mean, PHP already _has_ an "include" statement...

« previous php.internals (#131199) next »