Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-06-06 Thread Lester Caine
On 06/06/16 22:33, Sammy Kaye Powers wrote: > But the real hum-dinger was from Stack Overflow: > > http://stackoverflow.com/search?q=php+bom > > It does seem to be tripping up a lot of people, especially newbies. As > low as the learning curve is for PHP already, I'm curious if you folks > think

Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-06-06 Thread Sammy Kaye Powers
Hey Stanislav! > In general, I don't think BOM is a real issue worth messing with the > lexer. Surely, from time to time somebody would use weird editor which > produces BOMs, like editing PHP scripts in Word. Surely, they'd have > weird effects that would force them to spend 5 minutes googling

Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-05-31 Thread Derick Rethans
On Mon, 30 May 2016, Stanislav Malyshev wrote: > If it is really becoming an issue, we could probably make the lexer > treat BOM+ enough issue. That that would break the case when somebody is trying to serve/generate a file which starts with a BOM though cheers, Derick --

Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-05-31 Thread Andreas Heigl
Hi All. As the BOM is only relevant on UTF-16 and UTF-32 encoded files and UTF-8-encoded files are strongly discouraged from having one[1] - (Use of a BOM is neither required nor recommended for UTF-8) there are two questions that arise IMO. 1. Does PHP support Files encoded in UTF16 or UTF-32?

Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-05-30 Thread Sara Golemon
On Mon, May 30, 2016 at 7:18 PM, Stanislav Malyshev wrote: >> In fact, the idea of stripping content from a script file isn't >> without precedent. Shebang lines are routinely removed from >> cli/cgi/fpm, and if you want to properly output it, you need to do so > > True,

Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-05-30 Thread Stanislav Malyshev
Hi! > In fact, the idea of stripping content from a script file isn't > without precedent. Shebang lines are routinely removed from > cli/cgi/fpm, and if you want to properly output it, you need to do so True, because in the context of CLI we know what is expected - a CLI script which can start

Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-05-30 Thread Ángel González
On 31/05/16 02:33, Sammy Kaye Powers wrote: BOM's should not be treated as characters and should not be sent to the output. Is there any reason this should be considered the expected behavior? If not, I'd like to create an RFC to change it. :) What about «Hello Foo! Today is » ? If there's a

Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-05-30 Thread Sara Golemon
On Mon, May 30, 2016 at 5:40 PM, Stanislav Malyshev wrote: >> BOM's should not be treated as characters and should not be sent to >> the output. Is there any reason this should be considered the expected >> behavior? > > The reason would be PHP does not know where surrounding

Re: [PHP-DEV] PHP's handling of BOM (byte order mark)

2016-05-30 Thread Stanislav Malyshev
Hi! > BOM's should not be treated as characters and should not be sent to > the output. Is there any reason this should be considered the expected > behavior? The reason would be PHP does not know where surrounding output ends and the code starts, beyond http://www.php.net/unsub.php

[PHP-DEV] PHP's handling of BOM (byte order mark)

2016-05-30 Thread Sammy Kaye Powers
Hey internals! In a recent discussion on PHP Roundtable, we talked about the byte order mark in php files. If you create a php file with the following: PHP Warning: Cannot modify header information - headers already sent by > (output started at %s:1) in %s on line %d But it doesn't seem to