<?php if ($a < 100) { $a++; } ?> 

or

 <?php if ($a < 100) { $a++; } ?> 

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants aleksandr barakin , ߊߚߤߘ , user194374, Denis Bubnov , rjhdby 13 Feb '17 at 15:01 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    ideologically correct to not put the closing ?> where to put braces is a matter of taste. - teran
  • 2
    If you look at PSR-2, it says the Открывающая фигурная скобка в управляющих конструкциях ДОЛЖНА располагаться в той же строке, что и сама конструкция, а закрывающая фигурная скобка ДОЛЖНА располагаться на следующей строке после тела конструкции. ...... but in fact it is sometimes a matter of taste, and in some companies it is sometimes obliged to comply with its internal standard, which can be written in a completely different way - Alexey Shimansky
  • 3
    Ideologically correct to put braces equally . The main thing is not the chosen option, but the integrity of the style. - vp_arth

1 answer 1

There are standards for writing the code PSR-0, PSR-1, PSR-2, PSR-3, PSR-4 . There are a lot of things written. Read. Somewhere in the first version, and somewhere in the second (Egyptian style).

  • 2
    only two of them are related to the question - etki