Comment on Most Pressed Keys and Programming SyntaxesComments−Kwpolska15yDoesn't PHP use a colon at the end of every line? WTF?−shabble15yNo.It uses a semicolon to delimit statements within blocks, but (afaik) placing each statement inside its own <?php ... ?> tag would be valid.There's also the alternative syntax[1], which is mostly used for templating these days, which looks like <?php if ($foo): ?> ... html ... <?php endif; ?> and is probably the only place other than a ternary operator that might conceivably end a line with a colon.[1] http://php.net/manual/en/control-structures.alternative-synt...−Kwpolska15ybut the <?php ?> don't seem to be used too much on this heatmap.−Androsynth15yAs php code gets more structured, its moving towards MVC frameworks where php tags are used sparingly in the views. (they are a fast way to make spaghetti code)
Comments
Doesn't PHP use a colon at the end of every line? WTF?
No.
It uses a semicolon to delimit statements within blocks, but (afaik) placing each statement inside its own <?php ... ?> tag would be valid.
There's also the alternative syntax[1], which is mostly used for templating these days, which looks like
and is probably the only place other than a ternary operator that might conceivably end a line with a colon.[1] http://php.net/manual/en/control-structures.alternative-synt...
but the <?php ?> don't seem to be used too much on this heatmap.
As php code gets more structured, its moving towards MVC frameworks where php tags are used sparingly in the views. (they are a fast way to make spaghetti code)