There is a thing make me puzzled in 2.2 of PSR-2 document.
All I know is that different os use different line ending as default :
- windows:CRLF
- unix:LF
- mac:CR
I want to know why should "All PHP files MUST use the Unix LF(linefeed) line ending" . Or in other word, what will line ending cause ?
The main reason behind this is scv (Source Code Versioning), where changing line-endings cause unnecessary differences and conflicts.
Secondly, we usually serve our services on Linux, which is based on Unix, which use the
LF
file ending.The first one causes the need of a Standard, and the second one tells you why you should use
LF
Standard.Update: also note that, whilst PHP - and imo. all the other scripting languages - doesn't really depend on a specific line-ending, in other languages this might cause issues.