RE: [PHP-DEV] [Concept] declare(strict_identifiers=1)

"Juris Evertovskis" <[email protected]>
Newsgroups gmane.comp.php.devel
Message-ID <[email protected]>
> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Wednesday, August 26, 2026 6:15 PM
> To: [email protected]
> Subject: [PHP-DEV] [Concept] declare(strict_identifiers=1)
> 
> [..] I am proposing a per-file declare under which the accepted set
> is specified: well-formed UTF-8, UAX31-R1-2 with the standard Default-
> Ignorable Exclusion Profile, and NFC required rather than applied. Identifiers
> consisting only of bytes below 0x80 are never examined, so existing code
> pays nothing.

Hey Luca,

To prevent errors? I must admit I don't rly understand all the terms.
I assume it implies identifiers should be more visible/readable, right?

> To find out what this would break I surveyed the 250 most-downloaded

Why would anything break if it's per-file?

> Packagist packages and 250 GitHub repositories -- 168,604 PHP files -- using
> ext/tokenizer. The Packagist corpus contains exactly one non-ASCII identifier,
> and no identifier in either corpus is non-NFC.

Do I understand it correctly that by adding that declare to 168604 you would uncover
a single risky identifier? Not that convincing... 

Would it be fair to say that the same constraints can be enforced by linters/cs tooling?

BR,
Juris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.