Answer the question
In order to leave comments, you need to log in
Is it correct not to put a line break in this case?
A colleague of ours got into an argument about a single line break. I'll show you with an example.
$data = [];
foreach ($items as $item) {
$data[] = getStuff($item);
}
Answer the question
In order to leave comments, you need to log in
He says no, because. $data and foreach form a single logical structure - the variable is used in the loop.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question