|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24209 Closing PHP tag and line comment
Submitted: 2003-06-16 15:03 UTC Modified: 2003-06-16 15:05 UTC
From: nicolas dot sandri at free dot fr Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.2 OS: FreeBSD & Mac OS X
Private report: No CVE-ID: None
 [2003-06-16 15:03 UTC] nicolas dot sandri at free dot fr
See the code, end of line comment "//" and "##" does 
not work with the PHP ending tag.
It could be not very important but, if you have a line 
like that :
echo "<?xml version=\"1.0\"?>";
You comment it with "//" and now the PHP script exit 
since it found the "?>" into line.
The only way is to use the "/* */" comment.

Reproduce code:
echo "I'm ";
// ?>
echo "outside the PHP script";

Expected result:
I'm outside the PHP script

Actual result:
I'm echo "outside the PHP script"; ?>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-16 15:05 UTC]
Known and expected.  Probably even documented somewhere too.
 [2003-06-16 15:05 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

read the docs...
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jul 04 00:05:44 2022 UTC