Re: [PHP-DEV] No longer allow block mode for declare(encoding)

2022-08-31 Thread Hans Henrik Bergan
>it might be hard to properly implement support

No effort should be wasted supporting this.
+1

On Wed, Aug 31, 2022, 21:21 Sara Golemon  wrote:

> On Wed, Aug 31, 2022 at 10:43 AM Christoph M. Becker 
> wrote:
>
> > 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].
> >
> >
> I think I can imagine scenarios where switching encodings within a file
> would work?  Especially for ASCII transparent encodings...  That said,
> if you're currently depending on multiple encodings in a single file then
> you probably deserve whatever you get.
>
> +1
>
> -Sara
>


Re: [PHP-DEV] No longer allow block mode for declare(encoding)

2022-08-31 Thread Sara Golemon
On Wed, Aug 31, 2022 at 10:43 AM Christoph M. Becker 
wrote:

> 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].
>
>
I think I can imagine scenarios where switching encodings within a file
would work?  Especially for ASCII transparent encodings...  That said,
if you're currently depending on multiple encodings in a single file then
you probably deserve whatever you get.

+1

-Sara


[PHP-DEV] No longer allow block mode for declare(encoding)

2022-08-31 Thread Christoph M. Becker
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] 
[2] 

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php