Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106576 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60808 invoked from network); 14 Aug 2019 00:59:45 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 14 Aug 2019 00:59:45 -0000 To: internals@lists.php.net References: <25d774e8-183b-d39c-4ac4-81c1b7770229@gmail.com> <5d5298a5.1c69fb81.b4ed1.2d97SMTPIN_ADDED_MISSING@mx.google.com> <3db68c5e-54d1-812f-bbf5-1b089cba1bff@gmail.com> <5d52f72d.1c69fb81.8f95f.57a1SMTPIN_ADDED_MISSING@mx.google.com> <2bcb05d6-abf6-4fcb-599e-eaf4bcd58878@gmail.com> Date: Tue, 13 Aug 2019 23:28:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <2bcb05d6-abf6-4fcb-599e-eaf4bcd58878@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Posted-By: 94.4.34.143 Subject: Re: [PHP-DEV] [RFC] Namespace-scoped declares, again From: markyr@gmail.com (Mark Randall) Message-ID: On 13/08/2019 21:26, Rowan Collins wrote: > Ah, that makes sense. Does that necessarily mean we need a dummy class, > though? The autoloading logic in the engine knows that it called the > autoload callback expecting a package definition, so can count as > success that the package is now defined. > > In other words, the file the autoloader included would look like this > (again, sticking to the notion that "package" is separate from > "namespace"): Personally with file-level opt ins I'm not 100% sold on the benefits of packages over namespace level information. I guess I'm not certain on what problem they're trying to solve that's different from just another object at namespace level. As for the dummy class, the only real benefit is that existing autoloading procedures can be used to locate it and be included with minimal overhead. PHP can call the autoloader internally but it would require userland loaders to be upgraded with it, not exactly a huge stretch, especially with most things being composer-based, but a dummy class would make it work out the box, including optimization steps like dumping the class list. Mark Randall