--TEST--
Bug #66731: file: extensive backtracking, with pcre.jit=0
--EXTENSIONS--
fileinfo
--SKIPIF--
<?php
if (defined("PHP_DEBUG") && PHP_DEBUG)
    die("skip not suitable for debug build");
if (getenv('SKIP_PERF_SENSITIVE'))
    die("skip performance sensitive test");
?>
--INI--
pcre.jit=0
--FILE--
<?php
$fd = __DIR__.'/cve-2014-3538-nojit.data';

file_put_contents($fd,
  'try:' .
  str_repeat("\n", 1000000));

$fi = finfo_open(FILEINFO_NONE);
$t = microtime(true);
var_dump(finfo_file($fi, $fd));
$t = microtime(true) - $t;
if ($t < 2) {
    echo "Ok\n";
} else {
    printf("Failed, time=%.2f\n", $t);
}

?>
Done
--CLEAN--
<?php
@unlink(__DIR__.'/cve-2014-3538-nojit.data');
?>
--EXPECTF--
string(%d) "%s"
Ok
Done
