php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31328 Parser Error under Apache
Submitted: 2004-12-28 22:36 UTC Modified: 2004-12-28 23:09 UTC
From: kevin_tom at hotmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.8 OS: Linux 6.2
Private report: No CVE-ID: None
 [2004-12-28 22:36 UTC] kevin_tom at hotmail dot com
Description:
------------
configure command line:

'./configure' '--with-zlib' '--with-mysql=/var/lib/mysql' '--with-apxs=/usr/sbin/apxs' '--with-oci8=/u01/app/oracle/product/8.1.7' '--with-mssql=/usr/local/freetds'

Browser: IE6 & Firefox by far

This is a purely PHP parser problem, I think. It can't determine if the "{" and "}" inside HTML comment tags.
Problematic codes:

---------------------------------------
Begin of html/php file
These are html codes
<!--
<?}?>
-->
<br>
End of htm file
---------------------------------------

The HTML comment should take privilege over the PHP tag thus these codes shouldn't generate a problem, but it does.

Error:
Parse error: parse error, unexpected '}'



Reproduce code:
---------------
Begin of html/php file
These are html codes
<!--
<?}?>
-->
<br>
End of htm file


Expected result:
----------------
Begin of html/php file
These are html codes
End of htm file

Actual result:
--------------
Parse error: parse error, unexpected '}' on line 7

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-28 23:09 UTC] derick@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

PHP is run before your browser does the html comments... PHP doesn\'t care about the HTML at all and tries to parse your script which has an error here.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Sep 21 18:00:01 2025 UTC