php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11330 Regexp code cannot be commented out
Submitted: 2001-06-07 11:44 UTC Modified: 2001-06-07 14:21 UTC
From: bf at ez dot no Assigned:
Status: Closed Package: Regexps related
PHP Version: 4.0.5 OS: Linux
Private report: No CVE-ID: None
 [2001-06-07 11:44 UTC] bf at ez dot no
I have code like this:
$tmpPage = preg_replace( "/(<header\s*?>)/", "<header 
level=\"1\">", $tmpPage );

Ok, I want to comment this code out like:
//$tmpPage = preg_replace( "/(<header\s*?>)/", "<header 
level=\"1\">", $tmpPage );

this makes php angry. It'e reproducable, just paste the 
line above in your script and strange things will happen.

PS: The code works without the comment, so the code is 
valid.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-07 14:21 UTC] sniper@php.net
http://www.php.net/manual/en/language.basic-syntax.comments.php

Use /* */ style comments instead and you won't have 
this kind of problems.  ?> in your code is seen as end
of PHP block. 

Not a bug.

--Jani

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 06:01:27 2019 UTC