php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9109 Comments and regular expressions make problems
Submitted: 2001-02-05 07:22 UTC Modified: 2001-03-06 08:13 UTC
From: php at tricos dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: Redhat Linux 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at tricos dot com
New email:
PHP Version: OS:

 

 [2001-02-05 07:22 UTC] php at tricos dot com
This is a problem:

/*
	$pnr=preg_replace("/[a-zA-Z]*/", "", $pnr);
*/	

As you can see this is a line that has been commented out.
The problem is that the engine thinks that the "*/" within the REGEX itself is the end of the comment making it impossible to comment this line out.
This is a big problem if you have a whole block of expressions containing REGEX which you want to comment out!

What about a fix?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-06 08:13 UTC] stas@php.net
Right. Engine cannot parse your comments as if they were PHP
code (because they are not), so be careful.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 12:01:29 2025 UTC