On Tue, Jul 7, 2020 at 4:47 PM Larry Garfield <la...@garfieldtech.com> wrote:
> On Tue, Jun 23, 2020, at 7:30 PM, Larry Garfield wrote: > > Greetings, Internalians. > > > > There has been much talk of the \PHP namespace of late, including one > > unsuccessful RFC. In the discussion, the pushback broke down into two > > main camps: > > > > * We should never namespace anything ever. > > * We can namespace things but we need something more concrete than > > "RFCs can namespace things if they feel like it." > > > > I can't do much about the former, but the latter is a solvable problem. > > To that end, Mark Randall and I have put together a new RFC on the > > topic, based on a fruitful discussion in Room 11 a few weeks ago to > > brainstorm what actual guidelines should be for what goes where. > > > > https://wiki.php.net/rfc/php_namespace_policy > > > > This proposal provides guidance to short circuit future subjective > > bikeshedding, while still leaving some wiggle room for case-by-case > > evaluation as needed. That makes it different from prior attempts that > > did not provide clear guidance for future RFC authors. > > > > The specific guidelines offered may or may not appeal to you; those are > > open to discussion (within reason; we don't want to end up back in "do > > whatever" land as we know that won't help), but the more important > > point is that clear guidelines are provided. > > > > Also of note, although it uses existing code to demonstrate where > > classes *would* go under this plan it does not immediately move > > anything. Those are left for future RFCs that would have to stand or > > fall on their own merit. It also provides for a very long grace period > > for any such transitions to minimize disruption. > > > > The intent is to bring this proposal to a vote in time for 8.0's freeze > > one way or another, even though it's unlikely to have any impact on 8.0 > > itself. It's still a convenient deadline. > > > > *dons flame retardant suit* > > > > -- > > Larry Garfield > > la...@garfieldtech.com > > This has reached the 2 week mark, but there's not been much discussion. > Anyone else want to weigh in? > > I want to give it a few more days and possibly revise it to include a Wiki > page as suggested, but probably will bring it to a vote within the next > week or so. > Hey Larry, As far as I can see, this RFC still doesn't address a primary concern from previous discussions: Extensions may get moved between PHP and PECL. The only discussion of this issue seems to be this bullet point: > If a feature is removed from PHP-SRC (either to PECL or dropped entirely) its previously claimed component namespace remains reserved. It MAY be released by a subsequent RFC, following the standard RFC procedure, at least one minor version after the feature is removed. That delay is to minimize backward compatibility impact and allow userland code to migrate if appropriate. To reiterate what the problem is: If the "PHP" namespace is only used by extensions bundled with php-src, then any time we import an extension from PECL, that means all the symbols in that extension must get renamed. This is disruptive to any existing users of the extension, who now have to deal with different symbol names depending on which PHP version they use. Similarly, when extensions get unbundled and moved to PECL, my current reading of your RFC is that the extension would initially retain the PHP\ namespace prefix, even though it is no longer vendored by PHP, but the extension namespace may get reused at a later point in time (which seems counter-productive to the goal of avoiding naming collisions). For me, dealing with PHP <-> PECL moves is an important part of adopting namespaces in php-src, and I don't think the current proposal addresses this issue sufficiently. (One way to address it would be to drop the PHP\ prefix, and use unvendored namespace names for php-src.) Regards, Nikita