Edit report at https://bugs.php.net/bug.php?id=55345&edit=1
ID: 55345 Updated by: paj...@php.net Reported by: mac_doggie at hotmail dot com Summary: comment / php endtag -Status: Open +Status: Bogus Type: Bug Package: Scripting Engine problem Operating System: Windows 7 64-bits PHP Version: 5.3SVN-2011-08-02 (SVN) Block user comment: N Private report: N New Comment: Disable the short tag and it will work. Previous Comments: ------------------------------------------------------------------------ [2011-08-02 11:05:28] mac_doggie at hotmail dot com Description: ------------ When my source contains this code: <?php // $DOMDoc = new DOMDocument(); // $DOMDoc->loadXML("<?xml version=\"1.0\" encoding=\"utf-8\"?><annotations><annotation><type>Goal</type><datetime>12-07-2011 14:05:03</datetime></annotation><annotation><type>Corner</type><datetime>12-07-2011 14:09:33</datetime></annotation></annotations>"); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> <request>"; ?> it will generate a parse error unexpected T_STRING at the echo command... If I remove the comment the error is resolved. The cause of this lies in the php endtag ?> witch is found in the comment (in this case this is not even the php endtag but an xml endtag...) Putting a space in between ? > is enough to make it work again, but I still think of this behaviour as a bug. Test script: --------------- not working: <?php // $DOMDoc = new DOMDocument(); // $DOMDoc->loadXML("<?xml version=\"1.0\" encoding=\"utf-8\"?><annotations><annotation><type>Goal</type><datetime>12-07-2011 14:05:03</datetime></annotation><annotation><type>Corner</type><datetime>12-07-2011 14:09:33</datetime></annotation></annotations>"); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> <request>"; ?> working (space between ? and >): <?php // $DOMDoc = new DOMDocument(); // $DOMDoc->loadXML("<?xml version=\"1.0\" encoding=\"utf-8\"? ><annotations><annotation><type>Goal</type><datetime>12-07-2011 14:05:03</datetime></annotation><annotation><type>Corner</type><datetime>12-07-2011 14:09:33</datetime></annotation></annotations>"); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> <request>"; ?> Expected result: ---------------- <?xml version=\"1.0\" encoding=\"utf-8\"?> <request> Actual result: -------------- <br /> <b>Parse error</b>: syntax error, unexpected T_STRING in <b>/usr/big_disk/www/Rogier/voetbal_applicatie/php/main.php</b> on line <b>5</b><br /> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55345&edit=1