Re: [RFC] Namespace-scoped declares, again

From: Date: Wed, 14 Aug 2019 10:07:28 +0000
Subject: Re: [RFC] Namespace-scoped declares, again
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-106589@lists.php.net to get a copy of this message
śr., 14 sie 2019 o 11:49 Rowan Collins <rowan.collins@gmail.com> napisał(a): > > You suggest that it would trigger autoload to load "MyVendor\MyPackage" > > but current autoload machinery is able to load only classes, > > not even functions or consts! cause it gets the only class name now. > > It would need to be changed anyway. > > > As I said in another reply, this is only the same change that needed to > be made to support "trait" alongside "class" and "interface", or > would > be needed to support "enum" or "struct". The userland part of the > autoloader already doesn't know which of those it's looking for, so the > only constraint is that the names can't collide, so you couldn't name a > package the same thing as a class. > > Exactly so how would it know from string name either it should load class from src/Foo.php or src/__nsmeta.php if there is no information? -- regards / pozdrawiam, -- Michał Brzuchalski about.me/brzuchal brzuchalski.com

« previous php.internals (#106589) next »