php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6332 preg_replace does not abide by limit argument
Submitted: 2000-08-24 07:22 UTC Modified: 2000-08-24 09:25 UTC
From: jmoore@php.net Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Latest CVS (24/08/2000) OS: Win32
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jmoore@php.net
New email:
PHP Version: OS:

 

 [2000-08-24 07:22 UTC] jmoore@php.net
Using Zeevs Build of RC1 on Win32 the preg_replace function either does not work as I expected or ignores limit, taking the example from the manual..

======= test.php =========
<?php
$html_body = "<hello><this><is><a><test>";
print preg_replace ("/(<\/?)(\w+)([^>]*>)/e", "'\\1'.strtoupper('\\2').'\\3'", $html_body, 2);
?> 
===========================

Expected Output:
<HELLO><THIS><is><a><test>

Actual output:
<HELLO><THIS><IS><A><TEST>

I suppose at least ignoreing it you dont get the same error as in pl2 where it gave wrong parameter count...

-James

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-24 09:25 UTC] andrei@php.net
Fixed in CVS, thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 03:01:29 2024 UTC