Re: Re: Should hash comments be deprecated?
| From: | tyson andre | Date: | Sat, 29 Aug 2020 17:22:26 +0000 |
| Subject: | Re: Re: Should hash comments be deprecated? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111708@lists.php.net to get a copy of this message | ||
Hi internals,
If it turns out that the impact on legacy applications, legacy libraries, or holding back upgrades
is a concern for others
(I'm not sure what the most common opinion is),
another option would be a system ini setting
hash_comment = 0|1|2
0 - disable #comment support completely when parsing/lexing - throw a ParseError while
lexing and return T_ERROR in token_get_all
1 - (default) emit a compilation warning or deprecation notice when parsing files mentioning that
hash comments will be removed in a future major release. Do this only for the first comment.
2 - allow it silently (possibly an unnecessary option to provide)
Then, this could be gradually strictened
- Forbid option 2 in php 8.x
- change the default ini setting value to 0 in 8.x or 9.0
- Add a configuration setting in php 8.x or 9.x to always disable hash comments
- Remove support
> Correct me if I'm wrong, but the shebang goes before the PHP opening
> tag <?php and thus this is not relevant. In fact, shebang is already a
> special case.
Yes, shebang can only be parsed on the first line of a script - before <?php
sections.
Thanks,
- Tyson