Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#11 Make foreach equivalent to for with resp. to indentation

closed
nobody
None
5
2007-11-05
2003-05-21
Nils Rennebarth
No

"for" is recognized as starting a new block, just as
"while" and "if".
"foreach" should be equivalent to "for" as far as
indentation is concerned,
it is not however, the syntax engine handles a foreach
block like a
function call

E.g, when I enter
for ($i=0; $i<10; $i++)
and then hit the '{' key, a newline is inserted
automatically
afterwars and the indentation level is increased by one.

When I enter
foreach($a as $k=>$v)
however and hit the '{' key, a newline is inserted
before the brace,
another afterwards and the indentation levels is
increased by
two.

Discussion

    • status: open --> closed