mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
We fix the `UNEXPECTED(EXPECTED(…))`, which does not make sense, and replace the magic number with the respective macro. We also add a test case to verify the expected behavior for an `array_fill()` edge case. Closes GH-8804.
20 lines
347 B
PHP
20 lines
347 B
PHP
--TEST--
|
|
array_fill(): last element
|
|
--FILE--
|
|
<?php
|
|
$a = array_fill(PHP_INT_MAX, 1, "foo");
|
|
var_dump(
|
|
count($a),
|
|
array_key_exists(PHP_INT_MAX, $a),
|
|
);
|
|
try {
|
|
$a[] = "bar";
|
|
} catch (Error $ex) {
|
|
echo $ex->getMessage(), PHP_EOL;
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
int(1)
|
|
bool(true)
|
|
Cannot add element to the array as the next element is already occupied
|