mirror of
https://github.com/php/php-src.git
synced 2025-01-07 03:13:33 +08:00
03cbbf4348
patch by: slugonamission at gmail dot com
26 lines
502 B
PHP
26 lines
502 B
PHP
--TEST--
|
|
Backtracking limit
|
|
--SKIPIF--
|
|
<?php
|
|
if (@preg_match_all('/\p{N}/', '0123456789', $dummy) === false) {
|
|
die("skip no support for \p support PCRE library");
|
|
}
|
|
?>
|
|
--INI--
|
|
pcre.backtrack_limit=2
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(preg_match_all('/.*\p{N}/', '0123456789', $dummy));
|
|
var_dump(preg_last_error() === PREG_BACKTRACK_LIMIT_ERROR);
|
|
|
|
var_dump(preg_match_all('/\p{Nd}/', '0123456789', $dummy));
|
|
var_dump(preg_last_error() === PREG_NO_ERROR);
|
|
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|
|
bool(true)
|
|
int(10)
|
|
bool(true)
|