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
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:
MUST BE VALID
Solve the problem:
46 + 1 = ?
Subscribe to this entry?

 
 [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: Sun May 19 16:01:31 2024 UTC