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:
16
ext/standard/tests/array/array_diff_max_elements.phpt
Normal file
16
ext/standard/tests/array/array_diff_max_elements.phpt
Normal 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
|
||||
Reference in New Issue
Block a user