1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/pcre/tests/gh16189.phpt
2024-10-03 12:48:13 +01:00

20 lines
588 B
PHP

--TEST--
GH-16189 (preg_match/preg_match_all underflow on start_offset argument)
--FILE--
<?php
try {
preg_match( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '<br><div id="S44_i89ew">', $matches, 0, PHP_INT_MIN);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
}
try {
preg_match_all( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '<br><div id="S44_i89ew">', $matches, 0, PHP_INT_MIN);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
}
?>
--EXPECTF--
preg_match(): Argument #5 ($offset) must be greater than %s
preg_match_all(): Argument #5 ($offset) must be greater than %s