This question already has an answer here:
In PHP or Python (or whatever) the interpreter read the program line by line. So if I put a lot of linebreaks or empty lines, does the code need more interpreting time to execute? (Since it reads the whole bunch of my bad written code).
What about whitespaces and tabs? Does it matter?
I think more white space and more tabs mean more bytes, more long file size, more time to read the file.
Does it mean more time to read/process the source by the interpreter?
</div>
According to author David Sklar in Learning PHP 5:
You can put as many blank lines between statements as you want. The PHP interpreter ignores them. The semicolon tells the interpreter that one statement is over and another is about to begin. No whitespace at all or lots and lots of whitespace between statements doesn't affect the program's execution. (Whitespace is programmer-speak for blank-looking characters such as space, tab, and newline.)
In practice, it's good style to put one statement on a line and to put blank lines between statements only when it improves the readability of your source code...
So, feel free to use blank space and tabs to format your PHP code so that it is legible.
Python is different from PHP and there are specific guidelines about how to format your code with blank space; see here.