I just want to know which formatting method I should prefer if I need to declare a variable block.
I have seen the alignment style several times:
$foo = 'foo';
$bar = 'bar';
$foobar = 'foobar';
$baz = 'baz';
and assignment style:
$foo = 'foo';
$bar = 'bar';
$foobar = 'foobar';
$baz = 'baz';
Is there a standardized way or an official guide for this? I have already looked for this in PSR-1 and PSR-2 but it seems that these standards are not coping with this issue.
And if there is no official answer, how do other languages do it and why do they prefer how they do it?
source
share