Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106586 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59391 invoked from network); 14 Aug 2019 12:00:31 -0000 Received: from unknown (HELO poczta.brzuchalski.com) (188.165.245.118) by pb1.pair.com with SMTP; 14 Aug 2019 12:00:31 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by poczta.brzuchalski.com (Postfix) with ESMTP id ABBD0298423A for ; Wed, 14 Aug 2019 11:29:07 +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 9b9uX2t3tLfa for ; Wed, 14 Aug 2019 11:28:11 +0200 (CEST) Received: from mail-ot1-f50.google.com (unknown [209.85.210.50]) by poczta.brzuchalski.com (Postfix) with ESMTPSA id 361C12984236 for ; Wed, 14 Aug 2019 11:28:11 +0200 (CEST) Received: by mail-ot1-f50.google.com with SMTP id b1so12662046otp.6 for ; Wed, 14 Aug 2019 02:28:11 -0700 (PDT) X-Gm-Message-State: APjAAAVi5vfJZzhHqyxFCfCFksPgddlfsGa3hPVIj6U1GvVNkqx3jWbh gxxS0oVSR39ZFNMkOKq2Knyc9ZNLNPJIs1TT/AM= X-Google-Smtp-Source: APXvYqxyTF+VMcAgxZ7lzn/5cDQTrufRnrFhA7RI194Yf2q7o5kFu/FEWXZxCZYC+4sf1tSzM+JcDg3PYyvGQzfs7IE= X-Received: by 2002:a05:6830:1bf4:: with SMTP id k20mr25076709otb.79.1565774889702; Wed, 14 Aug 2019 02:28:09 -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> In-Reply-To: <182a6bd5-4057-7ba1-2cca-ab0be37e0b75@gmail.com> Date: Wed, 14 Aug 2019 11:27:57 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Rowan Collins Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000195bef05901060ca" Subject: Re: [PHP-DEV] [RFC] Namespace-scoped declares, again From: michal@brzuchalski.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --000000000000195bef05901060ca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =C5=9Br., 14 sie 2019 o 11:01 Rowan Collins napis= a=C5=82(a): > I don't see this as a problem. Right now, PHP doesn't care how many > files you put your code in. As far as I know, you could concatenate the > entirety of Laravel into one PHP file, and applications would not be > able to tell the difference. Similarly, you could put the whole thing in > a database and use eval() to execute it without touching any files. > > That is true but not if there are any declare statements. If so it could IMO work only like that: I think what attracts me to this idea is precisely that it doesn't > require much extra machinery. We could even use the trick that PHPStorm > uses for metadata stubs [1], and make the package definition look like > valid executable PHP, but never actually execute it: > > package Foo { > const declare =3D [ > 'strict_types' =3D> 1, > 'strict_operators' =3D> 1 > ]; > } > How could that know when need look for package definition? Example: # src/Foo.php