1--TEST--
2Next free element may overflow in array literals
3--FILE--
4<?php
5
6$i = PHP_INT_MAX;
7try {
8    $array = [$i => 42, new stdClass];
9    var_dump($array);
10} catch (Error $e) {
11    echo $e->getMessage(), "\n";
12}
13
14function test($x = [PHP_INT_MAX => 42, "foo"]) {}
15try {
16    test();
17} catch (Error $e) {
18    echo $e->getMessage(), "\n";
19}
20
21?>
22--EXPECT--
23Cannot add element to the array as the next element is already occupied
24Cannot add element to the array as the next element is already occupied
25