Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106589 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68248 invoked from network); 14 Aug 2019 12:39:07 -0000 Received: from unknown (HELO poczta.brzuchalski.com) (188.165.245.118) by pb1.pair.com with SMTP; 14 Aug 2019 12:39:07 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by poczta.brzuchalski.com (Postfix) with ESMTP id AD74F2984233 for ; Wed, 14 Aug 2019 12:07:43 +0200 (CEST) Received: from poczta.brzuchalski.com ([127.0.0.1]) by localhost (poczta.brzuchalski.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xg92tiGyvax6 for ; Wed, 14 Aug 2019 12:07:41 +0200 (CEST) Received: from mail-oi1-f170.google.com (unknown [209.85.167.170]) by poczta.brzuchalski.com (Postfix) with ESMTPSA id 7BEC72984236 for ; Wed, 14 Aug 2019 12:07:41 +0200 (CEST) Received: by mail-oi1-f170.google.com with SMTP id y8so2913485oih.10 for ; Wed, 14 Aug 2019 03:07:41 -0700 (PDT) X-Gm-Message-State: APjAAAXwP9VrdG0SF0jrddzlMvuc4O+6AZl2CbnF3fiW9Bjaj14USv0M xMEcAVgyHBT+E9lJJg4x/mS2YbNgYdarUK9XoJo= X-Google-Smtp-Source: APXvYqwPHkYcEkKWSIT3RVCcwMXJDj1UQwZdRgBXsNjBb6wCLkoLpwgiZ1glPX5vv3Yze0P+bYiP+swgvTTavEaVEv0= X-Received: by 2002:aca:d08:: with SMTP id 8mr4169369oin.51.1565777260344; Wed, 14 Aug 2019 03:07:40 -0700 (PDT) MIME-Version: 1.0 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> <182a6bd5-4057-7ba1-2cca-ab0be37e0b75@gmail.com> <72896017-20d0-16af-b188-8500777f947b@gmail.com> In-Reply-To: <72896017-20d0-16af-b188-8500777f947b@gmail.com> Date: Wed, 14 Aug 2019 12:07:28 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Rowan Collins Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000667d3c059010ed37" Subject: Re: [PHP-DEV] [RFC] Namespace-scoped declares, again From: michal@brzuchalski.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --000000000000667d3c059010ed37 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =C5=9Br., 14 sie 2019 o 11:49 Rowan Collins napis= a=C5=82(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? --=20 regards / pozdrawiam, -- Micha=C5=82 Brzuchalski about.me/brzuchal brzuchalski.com --000000000000667d3c059010ed37--