No longer allow block mode for declare(encoding)
| From: | Christoph M. Becker | Date: | Wed, 31 Aug 2022 15:43:15 +0000 |
| Subject: | No longer allow block mode for declare(encoding) | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-118544@lists.php.net to get a copy of this message | ||
Hi all,
recently, there was a bug report regarding declare(encoding)[1]. I've
checked that, and found that the current implementation of
declare(encoding) doesn't make sense regarding "block mode", since this
is completely ignored; instead, each (allowed) declare(encoding) works
from where it is written till the next declare(encoding) (well, probably
more or less).
Since I consider switching the character encoding in the middle of a
file not reasonable (and it might be hard to properly implement support
for that), I suggest to disallow block mode for declare(encoding) as of
PHP 8.3. A respective PR is available[2].
Thoughts?
[1] <https://github.com/php/php-src/issues/9446>
[2] <https://github.com/php/php-src/pull/9455>
--
Christoph M. Becker