summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/bug72685.phpt
blob: 7f6eabc182bcd1f6b50d781bc59a79bfd52d0b8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Bug #72685: Same string is UTF-8 validated repeatedly
--FILE--
<?php

$input_size = 64 * 1024;
$str = str_repeat('a', $input_size);

$start = microtime(true);
$pos = 0;
while (preg_match('/\G\w/u', $str, $m, 0, $pos)) ++$pos;
$end = microtime(true);
var_dump(($end - $start) < 0.5); // large margin, more like 0.05 in debug build

?>
--EXPECT--
bool(true)