1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00
Files
tekimen cc56225339 [RFC][mbregex] Set deprecate Oniguruma(mbregex) (#21490)
Set deprecate Oniguruma(mbregex)

Thank you for Oniguruma.

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2026-04-28 11:06:53 +09:00

37 lines
983 B
PHP

--TEST--
Test oniguruma stack limit
--EXTENSIONS--
mbstring
--SKIPIF--
<?php
if (!function_exists('mb_ereg')) die('skip mb_ereg not available');
if (@version_compare(MB_ONIGURUMA_VERSION, '6.9.3') < 0) {
die('skip requires Oniguruma 6.9.3');
}
?>
--FILE--
<?php
$s = str_repeat(' ', 30000);
ini_set('mbstring.regex_stack_limit', 10000);
var_dump(mb_ereg('\\s+$', $s));
ini_set('mbstring.regex_stack_limit', 30000);
var_dump(mb_ereg('\\s+$', $s));
ini_set('mbstring.regex_stack_limit', 30001);
var_dump(mb_ereg('\\s+$', $s));
echo 'OK';
?>
--EXPECTF--
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
bool(false)
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
bool(false)
Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d
bool(true)
OK