1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/standard/tests/array/array_diff_max_elements.phpt
ndossche 74fad61607 Add test for array_diff() array maximum
Forgot to commit this in 614b22ab.
2026-03-21 22:58:49 +01:00

17 lines
321 B
PHP

--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