1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add test for array_diff() array maximum

Forgot to commit this in 614b22ab.
This commit is contained in:
ndossche
2026-03-21 22:58:48 +01:00
parent f40b356ad9
commit 74fad61607

View File

@@ -0,0 +1,16 @@
--TEST--
array_diff(): Max elements
--FILE--
<?php
$power = 20; // Chosen to be well within a memory_limit
$arr = range(0, 2**$power);
try {
array_diff(...array_fill(0, 2**(32-$power), $arr));
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
The total number of elements must be lower than %d