1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 00:32:23 +01:00
Files
archived-php-src/ext/standard/tests/array/range/range_bug70239_2.phpt
divinity76 47e440019c improve range array overflow error message (#16510)
Improve range array overflow error message

Added info about "how much it exceeded" and the maximum allowable array size.

Makes debugging easier when encountering this specific issue.
2024-12-30 18:53:16 +01:00

13 lines
357 B
PHP

--TEST--
Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var 3
--FILE--
<?php
try {
var_dump(range(0, PHP_INT_MAX));
} catch (\ValueError $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECTF--
The supplied range exceeds the maximum array size by %d elements: start=0, end=%d, step=1. Calculated size: %d. Maximum size: %d.