When I was reading the PSR-2 documentation, I found that the & quot; php file uses the unxi-style lf linefeed & quot ;. We know that windows: CRLFunix: LFmac: CR, if I use lf for line feed encoding in windows, what will happen? There is another question about how line breaks will affect us...
When I was reading the PSR-2 documentation, I found that "the php file uses the unxi-style lf linefeed ".
We know that,
Windows: CRLF
Unix: LF
Mac: CR
What will happen if I use lf line breaks for encoding in windows?
Another question is, what kind of troubles will the line breaks bring to us? Or what kind of pitfalls will there be in coding?
Reply content:
When I was reading the PSR-2 documentation, I found that "the php file uses the unxi-style lf linefeed ".
We know that,
Windows: CRLF
Unix: LF
Mac: CR
What will happen if I use lf line breaks for encoding in windows?
Another question is, what kind of troubles will the line breaks bring to us? Or what kind of pitfalls will there be in coding?
Line breaks only Mark line breaks, because generally the character encoding is compatible with ASCII, and LF and CR are always 13 of 10 in ASCII, so there is no relevant pitfall in the encoding.
Currently, both IDE and general editors have line breaks. you only need to select the line breaks in the settings, whether in Windows or Linux.
Windows: CRLF, * nix: LF, and early macOS: CR are all default line breaks of the system. it does not mean that such line breaks can only be used in the corresponding system.