php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25987 php and xml tag confusion
Submitted: 2003-10-25 14:13 UTC Modified: 2003-11-04 17:09 UTC
From: tkwright_233 at hotmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: * OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tkwright_233 at hotmail dot com
New email:
PHP Version: OS:

 

 [2003-10-25 14:13 UTC] tkwright_233 at hotmail dot com
Description:
------------
when an xml 'starting' tag is placed on an document, php confuses it with its opining and closing tag.
it confuses its closing tag with xml end of the tag, and php confuses the open tag for php with the start of the tag declaring an xml document.

Parse error: parse error, unexpected T_STRING in c:/apache/htdocs/xml.php on line 1

currently, the workaround is:
<?php echo'<'.'?'.'x'.'m'.'l vers'.'ion="1'.'.'.'0'.'" en'.'codi'.'ng="UT'.'F-8'.'"'.'?'.'>'."\n";?>



Reproduce code:
---------------
<?xml version="1.0" encoding="UTF-8"?>

Expected result:
----------------
[no error],rest of page

Actual result:
--------------
Parse error: parse error, unexpected T_STRING in c:/apache/htdocs/xml.php on line 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-25 15:18 UTC] helly@php.net
Short tags = '<?'. That matches '<?php' as well as '<?=' or '<?xml'.
 [2003-10-26 15:24 UTC] gschlossnagle@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

It does recognize the difference, if you disable 
short_tags, which you should for exactly this reason.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC