xref: /PHP-7.3/ext/pcre/tests/backtrack_limit.phpt (revision 0fca0d9f)
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
11pcre.jit=0
12--FILE--
13<?php
14
15var_dump(preg_match_all('/.*\p{N}/', '0123456789', $dummy));
16var_dump(preg_last_error() === PREG_BACKTRACK_LIMIT_ERROR);
17
18var_dump(preg_match_all('/\p{Nd}/', '0123456789', $dummy));
19var_dump(preg_last_error() === PREG_NO_ERROR);
20
21?>
22--EXPECT--
23bool(false)
24bool(true)
25int(10)
26bool(true)
27