xref: /PHP-8.3/ext/pcre/tests/errors04.phpt (revision c5401854)
1--TEST--
2Test preg_match_all() function : error conditions - Backtracking 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_msg() === 'Backtrack limit exhausted');
17
18var_dump(preg_match_all('/\p{Nd}/', '0123456789', $dummy));
19var_dump(preg_last_error_msg() === 'No error');
20
21?>
22--EXPECT--
23bool(false)
24bool(true)
25int(10)
26bool(true)
27