Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106302 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 1967 invoked from network); 27 Jul 2019 11:09:16 -0000 Received: from unknown (HELO mail-qt1-f177.google.com) (209.85.160.177) by pb1.pair.com with SMTP; 27 Jul 2019 11:09:16 -0000 Received: by mail-qt1-f177.google.com with SMTP id k10so55042704qtq.1 for ; Sat, 27 Jul 2019 01:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SCispU7meFPZpDHN7ErNL4c1Wwb1vS2DU3U1YWAHXuk=; b=etYp1zEISG09RDifIa3s/8oZaGuqOA7L+RAtLlHMq7ndouVODaxhKuXtpoSmnl7HWa bGmDulU3EfYcRfCFK0Jo5Cr6YQ4PakLF2KM+AxnzI/96EBo1VpDOf3lZpU/LH9Q4C0+U CuB/5pXKGl5dDSVugTap1Z1HSBTF0WYIKRLUvF9qK587gG1RTYYwWeYjNL+eKPnb2af+ NspoKy/W94RG9Fdw7neeXxuGHsKCtSUV3rpGf0hByCH6bBqmuOCxZXIoYR5Jquv/ESNB DeCtsYUSOV36J6U8u9RQHiInfFE036I/Ji6LgOyPWJdI2dcNUEyfytxHdXl1AUHWmnOX GZwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SCispU7meFPZpDHN7ErNL4c1Wwb1vS2DU3U1YWAHXuk=; b=XOCJbSW/UuBdv5wdOd2DDkk8VHvqySM/bqD6ed5IZMc3tgFsV2E3sdRmbnuZZHt1Cr zbFYtSwpjO00CP++o6uCU9jJKZIDQLj92+thePD2JPAh51ar9h7ydaD7iPIAeRdsPd1u R1NUkSJaT+MGpJ3XHMrHMPaYJ5gJ/MsJpI/31Hut2FceLvs0dZvgv2bbIfj13aXrM++H fB7fKRLgXj2lekc2zw8l19nshFbuHKwHCiDdazfkyKoPnunYTGmYU5J9dtUZS3I+9/kX oUWyxTL6aZ8G+T3vgzAefmLCerBMDhJbzmN4HJzRdEw5S5w1PanDkkkNIW7hCbJR/idf Xbuw== X-Gm-Message-State: APjAAAUr+5TkP49raGwY/t1x5ZPuqCOvyQJ++pyZ4gqC3Srk4m7vP0O1 jsVWd67R/P10p1TllkXbkG5bkeAF4mTNW/M/vko= X-Google-Smtp-Source: APXvYqwxuxwV7LXn7IZXTXOL8wv4dujKgXtMw2qn2sqahFIEBIKtNktMn6+aYNoOZHkPJ1Vbw8j2mfVngaNAEwrbRno= X-Received: by 2002:aed:23ef:: with SMTP id k44mr67458043qtc.202.1564216401784; Sat, 27 Jul 2019 01:33:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 27 Jul 2019 10:33:15 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000fb067f058ea582ff" Subject: Re: [PHP-DEV] Re: [RFC] Namespace-scoped declares, again From: rasmus@mindplay.dk (Rasmus Schultz) --000000000000fb067f058ea582ff Content-Type: text/plain; charset="UTF-8" On Thu, Jul 25, 2019 at 3:34 PM Nikita Popov wrote: ... > Based on the received feedback, I plan to change this proposal from being > "namespace-scoped" to being "directory-scoped" instead ... I think that's a better approach. But please consider doing this without adding another global function that defines more global (compiler) state? If it's going to be directory-scoped, using some kind of project root file, in my opinion, is the more traditional way to declare directory-scoped boundaries. For example, if you could just put a "php.json" file in the root of your namespace folder, this becomes very easy to spot next to your ".gitignore", "composer.json", "package.json", "tsconfig.json" and any other well-known project configuration files. Finding these in the root of any project/library is pretty intuitive - poking through bootstrapping scripts for a global function call, meh, not so much. (This file could be used to declare other repetitive things too - for one, why is the declare() situation any different from having to repeat a namespace declaration in every file? This is just another global setting that could just as well be declared once in a project root file. If this file were parsable or reflectable by e.g. Composer, this could probably be used to make the "autoload" section in Composer optional, for one.) (You could expand upon this feature in the future to add other compiler options - for instance, toggling global functions, which would allow for things like correcting inconsistent argument order in the standard libraries, toggling incompatible language features, toggling improved defaults for certain functions, a proper strict type-checking mode at some point in the future, etc...) --000000000000fb067f058ea582ff--