Files
php-src/ext/mbstring/tests/oom_mb_parse_str_vars.phpt
Ilija Tovilo c1a5f468d0 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:12:35 +02:00

23 lines
544 B
PHP

--TEST--
mb_parse_str() doesn't reach hard limit - variable registration
--EXTENSIONS--
mbstring
--INI--
memory_limit=8M
max_input_vars=10000000
--FILE--
<?php
/* 100000 variables, under 1 MB of input: the name/value tables fit, but
* registering every variable does not. */
$query = '';
for ($i = 0; $i < 100000; $i++) {
$query .= ($i ? '&' : '') . "k$i=v";
}
mb_parse_str($query, $result);
echo "not reached\n";
?>
--EXPECTF--
Fatal error: Allowed memory size of 8388608 bytes exhausted %S(tried to allocate %d bytes) in %s on line %d