|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
19 - 19 = ?
Subscribe to this entry?

 [1998-12-05 11:16 UTC] auke at muze dot nl
   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 :)

Auke van Slooten


Add a Patch

Pull Requests

Add a Pull Request


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-2023 The PHP Group
All rights reserved.
Last updated: Sun Dec 03 01:01:27 2023 UTC