php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34769 Couldn't process xhtml prologue
Submitted: 2005-10-07 02:49 UTC Modified: 2005-10-07 09:25 UTC
From: sbcty at 126 dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.0.5 OS: Windows NT
Private report: No CVE-ID: None
 [2005-10-07 02:49 UTC] sbcty at 126 dot com
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-07 09:25 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Disable short tags in php.ini.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC