xref: /PHP-5.4/ext/pcre/tests/backtrack_limit.phpt (revision f4927c28)
1--TEST--
2Backtracking limit
3--SKIPIF--
4<?php
5if (@preg_match_all('/\p{N}/', '0123456789', $dummy) === false) {
6	die("skip no support for \p support PCRE library");
7}
8?>
9--INI--
10pcre.backtrack_limit=2
11--FILE--
12<?php
13
14var_dump(preg_match_all('/.*\p{N}/', '0123456789', $dummy));
15var_dump(preg_last_error() === PREG_BACKTRACK_LIMIT_ERROR);
16
17var_dump(preg_match_all('/\p{Nd}/', '0123456789', $dummy));
18var_dump(preg_last_error() === PREG_NO_ERROR);
19
20?>
21--EXPECT--
22bool(false)
23bool(true)
24int(10)
25bool(true)
26