xref: /PHP-8.0/Zend/tests/bug47836.phpt (revision f2b09969)
1--TEST--
2Bug #47836 (array operator [] inconsistency when the array has PHP_INT_MAX index value)
3--FILE--
4<?php
5
6$arr[PHP_INT_MAX] = 1;
7try {
8    $arr[] = 2;
9} catch (Error $e) {
10    echo $e->getMessage(), "\n";
11}
12
13var_dump($arr);
14?>
15--EXPECTF--
16Cannot add element to the array as the next element is already occupied
17array(1) {
18  [%d]=>
19  int(1)
20}
21