xref: /PHP-5.4/ext/pcre/tests/006.phpt (revision 13132206)
1--TEST--
2preg_replace() with array of failing regular expressions
3--INI--
4pcre.backtrack_limit=100000
5--FILE--
6<?php
7
8$text = '[CODE]&lt;td align=&quot;$stylevar[right]&quot;&gt;[/CODE]';
9$result = preg_replace(array('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU'), '', $text);
10var_dump($text);
11var_dump($result);
12
13$result = preg_replace('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '', $text);
14var_dump($text);
15var_dump($result);
16
17echo "Done\n";
18?>
19--EXPECTF--
20string(58) "[CODE]&lt;td align=&quot;$stylevar[right]&quot;&gt;[/CODE]"
21NULL
22string(58) "[CODE]&lt;td align=&quot;$stylevar[right]&quot;&gt;[/CODE]"
23NULL
24Done
25