Re: [PHP-DEV] [RFC] Strict Namespace Resolution

[email protected] (Tim Düsterhus) Thu, 16 Jul 2026 15:23:34 +0200
Newsgroups php.internals
Message-ID <[email protected]>
Hi

On 2026-07-15 19:18, Rowan Tommins [IMSoP] wrote:
> On 15 July 2026 16:54:04 BST, Ilija Tovilo <[email protected]> 
> wrote:
>> This flag forces the use of a \ prefix, but it's worth noting there 
>> are some communities (e.g. Laravel and Symfony) who have explicitly 
>> rejected the idea of prefixing all functions for readability reasons.
> 
> I know it won't change anyone's mind, but for the record, I've always 
> found this baffling. Adding a single punctuation mark next to function 
> calls seems far more readable to me than having a huge block of "use 
> function" lines at the top of every file.

FWIW, I agree. In Visual Studio Code it's also possible to adjust the 
styling of namespaces specifically, which would allow tuning down the 
backslash:

As an example, this config renders namespaces in black with 50% opacity:

     "editor.tokenColorCustomizations": {
         "textMateRules": [
             {
                 "scope": "support.other.namespace.php",
                 "settings": {
                     "foreground": "#0000007F"
                 }
             }
         ]
     }

Using `punctuation.separator.inheritance.php` as the scope will just 
affect the backslash specifically.

Best regards
Tim Düsterhus