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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 08:02:42 2024 UTC