php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #978 '//' comments don't work correctly?
Submitted: 1998-12-05 11:16 UTC Modified: 1998-12-05 16:57 UTC
From: auke at muze dot nl Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.5 OS: debian 2.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: auke at muze dot nl
New email:
PHP Version: OS:

 

 [1998-12-05 11:16 UTC] auke at muze dot nl
<?php
   echo "test<br>";
   // echo "blabla ?>";
   echo "this will not be executed";
?>

This script sees the '?>' in the outcommented string as the end of the php code. I'm not sure, but this looks incorrect to me (or at least I hope it's incorrect :)

When using /* .. */ style comments everything works as advertized :)

regards,
Auke van Slooten

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-12-05 16:57 UTC] zeev
This is intentional behavior, even though it's not trivial
to see it.  // comments work until the end of the line,
or the end of the PHP code, whichever comes first.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 15:01:36 2024 UTC