Re: Re: Should hash comments be deprecated?
| From: | David Rodrigues | Date: | Sat, 29 Aug 2020 19:25:40 +0000 |
| Subject: | Re: Re: Should hash comments be deprecated? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111709@lists.php.net to get a copy of this message | ||
I have suggested on past a declare() to help in cases like that:
declare(php_version = "8.0");
It could be declared to new PHP files, so old files could supports # as
comments and new files will not.
Other option is supports <?php8 syntax. And for future <?php81 for 8.1, so
on.
Em sáb, 29 de ago de 2020 14:22, tyson andre <tysonandre775@hotmail.com>
escreveu:
> 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
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>