From:             sbcty at 126 dot com
Operating system: Windows NT
PHP version:      5.0.5
PHP Bug Type:     Compile Failure
Bug description:  Couldn't process xhtml prologue

Description:
------------
If an xhtml file hava first line like this
    "<?xml version="1.0" encoding="UTF-8"?>"
PHP will report an error:
    "parse error, unexpected T_STRING in bug.php on line 1"

It seems to be PHP check (1)<? ... ?> or (2)<?php ... ?>
and think it contain PHP code. If document contain 
something like this (3)"<?... ... ?>" PHP will report an
error.

Reproduce code:
---------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<title>Bug Report</title>
</head>
<body>
    <?php echo 'Message ...'; ?>
</body>
</html>

Expected result:
----------------
This will work well. PHP couldn't to parse anything unless 
it is "<?php ...?>".

Actual result:
--------------
PHP Parse error:  parse error, unexpected T_STRING in bug.php on line 1


-- 
Edit bug report at http://bugs.php.net/?id=34769&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34769&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34769&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34769&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34769&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34769&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34769&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34769&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34769&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34769&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34769&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34769&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34769&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34769&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34769&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34769&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34769&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34769&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34769&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34769&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34769&r=mysqlcfg

Reply via email to