mirror of
https://github.com/php/php-src.git
synced 2026-03-25 00:32:23 +01:00
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.
13 lines
357 B
PHP
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.
|