|
| 1 | +--TEST-- |
| 2 | +GH-16189 (preg_match/preg_match_all underflow on start_offset argument) |
| 3 | +--FILE-- |
| 4 | +<?php |
| 5 | + |
| 6 | +try { |
| 7 | + preg_match( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '<br><div id="S44_i89ew">', $matches, 0, PHP_INT_MIN); |
| 8 | +} catch (\ValueError $e) { |
| 9 | + echo $e->getMessage() . PHP_EOL; |
| 10 | +} |
| 11 | +try { |
| 12 | + preg_match_all( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '<br><div id="S44_i89ew">', $matches, 0, PHP_INT_MIN); |
| 13 | +} catch (\ValueError $e) { |
| 14 | + echo $e->getMessage() . PHP_EOL; |
| 15 | +} |
| 16 | +?> |
| 17 | +--EXPECTF-- |
| 18 | +preg_match(): Argument #5 ($offset) must be greater than %s |
| 19 | +preg_match_all(): Argument #5 ($offset) must be greater than %s |
0 commit comments