ID:               25987
 Comment by:       danielc at analysisandsolutions dot com
 Reported By:      tkwright_233 at hotmail dot com
 Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: *
 PHP Version:      *
 New Comment:

This needlessly causes problems for users.  It would be nice to fix it,
please.



tkwright_233 seems on target when they say: PHP knows "the diffrence of
'<?=' from '<?'. so why can't it detect the diffrence of '<?' from
'<?xml'?"



Thanks.


Previous Comments:
------------------------------------------------------------------------

[2003-11-04 17:09:53] tkwright_233 at hotmail dot com

what just happened? it appears some comments were lost(about 2-4).

__________



Anyway, it DOES know the diffrence of '<?=' from '<?'. 

so why can't it detect the diffrence of '<?' from '<?xml'?



And, according to my brain, and museum.php.net, the deafult opining tag
was changed from '<?' to <?php' partially for this reason(and the
closing tag from '>' to '?>'), from v.2 to v.4 .

------------------------------------------------------------------------

[2003-10-26 15:24:32] [EMAIL PROTECTED]

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.

------------------------------------------------------------------------

[2003-10-25 15:18:05] [EMAIL PROTECTED]

Short tags = '<?'. That matches '<?php' as well as '<?=' or '<?xml'.

------------------------------------------------------------------------

[2003-10-25 14:13:23] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25987&edit=1

Reply via email to