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
 [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

Pull Requests

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: Sat Dec 21 13:01:31 2024 UTC