php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37049 ?> in // line breaks out of php mode
Submitted: 2006-04-12 02:59 UTC Modified: 2006-04-12 06:37 UTC
From: rishi at Udel dot edu Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.2 OS: OSX, linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rishi at Udel dot edu
New email:
PHP Version: OS:

 

 [2006-04-12 02:59 UTC] rishi at Udel dot edu
Description:
------------
This is similar to bug 12323 but still exists in php5 (i'm using 5.0.1) 
The following code should produce no output. However, it seems that the "?>" in the comment line breaks out of php interpretation mode and switches to direct output mode. The actual result appears in command line mode and browser mode.

I actually came upon the problem because in a more complicated script, it produced compile errors. However, in this simple script it produces unexpected output only.

Reproduce code:
---------------
<?php 
   //echo "?>\n".$buffer;
?>

Expected result:
----------------
No ouput

Actual result:
--------------
\n".$buffer;
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-12 06:37 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 Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 18:00:02 2026 UTC