Reputation: 436
I once posted a question here with php code embedded using <?
.
Someone told me I should NOT do that and I should use <?php
The person did not tell me why it is so. Can someone please explain why it is unsafe to use <?
?
Upvotes: 0
Views: 76
Reputation: 3201
<?
(the short tags) can be disabled in the PHP configuration, see short_open_tag
.
Why disable it? In some cases you'd want to use <?xml..
definitions for example, sure there are other ways to output that, but it's just safest to use <?php
- especially if you plan on moving your code from server to server.
Upvotes: 4