I am new in PhpStorm and I run into a problem when declaring xml on .php file, The problem I am talking about is that PhpStorm is refers the <? ?> as the short opening tags as php opening tags while I set short_open_tag = Off at the php.ini.
How can I set PhpStorm so it won't refer the short php opening tags as php opening tags?
PHPStorm as of now does not have any setting for that (see WI-2059 add "Disable short tags" option to project's options).
So you can not set that so far. All you can do is to write the code in a way that it does not clash, for example by echoing the XML declaration processing instruction:
<?php echo '<?xml version="1.0" encoding="utf-8" ?>' ?>
Variables, echos. Meh. Why not simply...
<<?php ?>?xml version="1.0" encoding="utf-8" ?>
No mess, no complains from PHPStorm or whatever. Basically, you may even use just <??> instead of <?php ?>, if you don't need the absolutely bulletproof solution covering both on and off cases for short_open_tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With