As the title says, when I was looking at the psr-2 document, I found that "php files use unxi-style lf newlines".
We know,
windows:CRLF
unix:LF
mac:CR
Then if I use lf line break when coding under Windows, what will be the impact?
One more question, what kind of trouble will newline characters bring us? Or are there any pitfalls in coding?
As the title says, when I was looking at the psr-2 document, I found that "php files use unxi-style lf newlines".
We know,
windows:CRLF
unix:LF
mac:CR
Then if I use lf line break when coding under Windows, what will be the impact?
One more question, what kind of trouble will newline characters bring us? Or are there any pitfalls in coding?
The newline character just marks a newline, because the usual character encodings are compatible with ASCII, and LF and CR are always 10 to 13 in ASCII, so there are no related pitfalls in the encoding.
At present, whether it is an IDE or a regular editor, basically all have line break settings. Just select the corresponding line break in the relevant settings, whether you are under Windows or Linux.
The Windows: CRLF, *nix: LF, and early macOS: CR you mentioned are just the default line breaks of the system. It does not mean that only this type of line break can be used in the corresponding system.