PHP opening tags and XML declaration

I am new to PhpStorm and I ran into a problem when declaring xml in a .php file. The problem I'm talking about is that PhpStorm refers to <? ?> <? ?> like short-opening tags, php, when I set short_open_tag = Off in php.ini .

How can I install PhpStorm so that it doesnโ€™t reference short php open tags like PHP open tags?

+1
source share
2 answers

Just put your XML in a variable and output it:

 <?php $xml = <<<XML <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <T3locallang> <meta type="array"> <description>CSH for Content Elements Table.</description> <type>CSH</type> <csh_table>tt_content</csh_table> </meta> </T3locallang> XML; echo $xml; ?> 

There is no other solution for PhpStorm, AFAIK.

+2
source

PHPStorm does not currently have any settings for this (see WI-2059 add the option "Disable short tags" for project parameters ).

Therefore, you cannot install this until now. All you can do is write the code so that it does not collide, for example, by repeating the XML declaration processing instruction:

 <?php echo '<?xml version="1.0" encoding="utf-8" ?>' ?> 
+5
source

All Articles