5
According to one of the items specified by the standard PSR2 (to which most PHP libraries), we have:
- Codes MUST use 4 spaces for indentation, not tabs.
I know the pattern exists, but I’d like to know if there’s any special reason.
What’s wrong with using tabs in PHP code?
Overall (even if it’s not PHP), using tabs instead of spaces can be a problem?
The question can be improved, downvoter?
– Wallace Maxters
Already OS survey of the year past it became clear which is the preference of the staff :D
\t
tabs tabs tabs tabs– rray
It is by preference, there is a page with the votes of the staff responsible for the specification. Some voted "tab" and most "spaces". As far as I know, the "tab" represents the space occupied by a column. In some IDE’s you can set the column width, so the space occupied by the tab will also be changed. With spaces this does not occur, that is, the space is the same of a character.
– Filipe Moraes
@Filipemoraes I don’t know if it’s just preference. I’ve seen git give inexplicable conflicts on tab.
– Wallace Maxters
See here the result of the vote, in the section "A.3. Survey Results" or "A.1. Survey Data": https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
– Filipe Moraes
Let’s use
\x09
:D– Guilherme Lautert
Those who did not understand the reference : http://187.7.106.14/Marcelo/org_comp/tableASCII.pdf, Hexadecimal
\x09
= Horizontal Tab HT– Guilherme Lautert