php.net |  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
Description:
------------
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"; ?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-16 15:05 UTC] rasmus@php.net
Known and expected.  Probably even documented somewhere too.
 [2003-06-16 15:05 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

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