O
O
Outsider V.2015-03-28 19:48:22
PHP
Outsider V., 2015-03-28 19:48:22

Vertical indents in PHP code?

Lately I've been trying to adjust my coding style to the PEAR standard. Now one point remains unclear: what are the generally accepted recommendations (in particular, in the PEAR standard - I did not find something in the documentation) about the intervals between individual blocks? I mean vertical indents in the form of newlines. For example, I often skip an empty line after a large if block, or, for example, separate blocks with initial values ​​assigned to variables with empty lines.
Example:

$foo = 15;
$bar = 10;

if ($foo > $bar) {
    $div = $foo/$bar;
    echo "Foo is $div times greater than bar.";
}

echo 'Some text.';

What do modern standards say about this? It is advisable to poke a finger in the documentation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
enixpp, 2015-03-28
@Audiophile

psr1
psr2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question