Files
php-src/ext/date/tests/oom_datetime_construct.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

15 lines
356 B
PHP

--TEST--
DateTime::__construct() doesn't reach hard limit
--INI--
memory_limit=64M
--FILE--
<?php
try {
new DateTime(str_repeat("\x01", 4 * 1024 * 1024));
} catch (\Throwable $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
DateMalformedStringException: Failed to parse time string (%s) at position 0 (%s): Unexpected character