PHP 4.0 Bug #6332: preg_replace does not abide by limit argument
| From: | jmoore@php.net | Date: | Thu, 24 Aug 2000 11:22:35 +0000 |
| Subject: | PHP 4.0 Bug #6332: preg_replace does not abide by limit argument | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-30497@lists.php.net to get a copy of this message | ||
From: jmoore@php.net
Operating system: Win32
PHP version: 4.0 Latest CVS (24/08/2000)
PHP Bug Type: Misbehaving function
Bug description: preg_replace does not abide by limit argument
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