blob: 793581ecd9b934dd2e1575c6a9e1b7a95e3a4bd7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
--TEST--
preg_replace() with array of failing regular expressions
--INI--
pcre.jit=0
pcre.backtrack_limit=100000
--FILE--
<?php
$text = '[CODE]<td align="$stylevar[right]">[/CODE]';
$result = preg_replace(array('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU'), '', $text);
var_dump($text);
var_dump($result);
$result = preg_replace('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '', $text);
var_dump($text);
var_dump($result);
echo "Done\n";
?>
--EXPECT--
string(58) "[CODE]<td align="$stylevar[right]">[/CODE]"
NULL
string(58) "[CODE]<td align="$stylevar[right]">[/CODE]"
NULL
Done
|