Answer the question
In order to leave comments, you need to log in
Is it recommended to write
I heard something about the fact that as the very first opening <? it is recommended to put <?php, but I can't google why. It seems (but did not understand then why) on makosi files c <? they just threw out the content when included, as if it were html. Help me understand how to do it.
PS. I understand that “short_open_tag = on” is not recommended in itself, but we have been writing like this for a long time, and there have been no problems yet.
Answer the question
In order to leave comments, you need to log in
Never heard anything like that about the first opening tag.
About "falling out the contents" with the short_open_tag enabled - too. Most likely it was some kind of mistake or typo.
For "On the case" no recommendations are needed, you can write as you like.
If you want maximum compatibility, then in the short form we write only <?=, and in other cases - in the long one.
You yourself have answered your own question. <? will only work with short_open_tag = on (otherwise throwing out all the content), and <?php with any value of this variable.
If you write purely for yourself, write in a way that suits you. If for someone - it's better to use <? php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question