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 and
> fixing it. I don't think it is the reason to spend day-persons of our
> collective time to find a fix to this very niche problem and risk
> potential BC issues.

The issue is that the BOM causes errors that are not easy to Google.
Some developers will have issues with their sessions not working.
Others with their custom headers not being sent. Others with "strange
characters" showing up everywhere. There are myriad reasons why any
one of those things could be happening that are not BOM related all
the while a BOM is sitting there in their files wearing an
"invisibility cloak" so-to-speak. :) So they potentially try 10 things
from Stack Overflow that don't fix the issue and give up.

I checked GitHub for issues related to this and a few quick searches
turned up a handful of issues possibly related to the BOM output:

https://github.com/search?l=PHP&q=%22byte+order+mark%22+headers+sent&ref=searchresults&type=Issues&utf8=%E2%9C%93
https://github.com/search?l=PHP&q=bom+headers+sent&ref=searchresults&type=Issues&utf8=%E2%9C%93

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 it's advantageous to have PHP ignore the BOM in std out in the
case of `{U+FEFF}<?php` to remove another stumbling block.

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

Reply via email to