M
M
may-cat2014-10-20 13:49:11
PHP
may-cat, 2014-10-20 13:49:11

Why does psr-1 say to use such a construct?

PSR-1 tells us:

В файлах НЕОБХОДИМО использовать только теги <?php и <?=.

Why such a genocide against the construction "<?"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-10-20
@may-cat

Because with <? Many problems. Rendering XML documents (yes, it happens), some other stuff, conflicts, etc. For this reason, it is disabled by default in php.ini. And for this reason, the standard says not to use this tag at all.

K
Konstantin Andreevich, 2014-10-20
@reffy

PHP also allows short tags <? and ?> , but they are not recommended, as they are only available if enabled with the php.ini configuration directive short_open_tag , or if PHP has been configured with the --enable-short-tags option.

https://php.net/manual/en/language.basic-syntax.ph...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question