|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16976 preg_replace /e causes access violation
Submitted: 2002-05-02 16:36 UTC Modified: 2002-06-04 04:28 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: sean at caedmon dot net Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 4.1.2 OS: Windows2000 / IIS5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sean at caedmon dot net
New email:
PHP Version: OS:


 [2002-05-02 16:36 UTC] sean at caedmon dot net
this code causes an access violation on IIS5/Windows2000/PHP4.1.2

Reports are that it works fine with apache4.0.6 (OS unknown):


$str = "here's some code:\n [code]//yep;\n \$a = 0; if (\$a < 1) { echo 'moo &amp;'; }\n[/code]";
$str = preg_replace('/(\[code\])([^\[]*)(\[\/code\])/ie', "'<br><br>code:<hr size=\"1\"><pre>' . htmlspecialchars('\\2') . '<hr size=\"1\"></pre>'", $str);

echo $str;




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-04 04:28 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Feb 26 13:01:27 2024 UTC