1--TEST--
2Test array_push() function : error conditions - max int value as key
3--FILE--
4<?php
5/*
6 * Use PHP's maximum integer value as array key
7 * then try and push new elements onto the array
8 */
9
10echo "*** Testing array_push() : error conditions ***\n";
11
12$array = array(PHP_INT_MAX => 'max');
13try {
14    var_dump(array_push($array, 'new'));
15} catch (\Error $e) {
16    echo $e->getMessage() . "\n";
17}
18var_dump($array);
19
20?>
21--EXPECTF--
22*** Testing array_push() : error conditions ***
23Cannot add element to the array as the next element is already occupied
24array(1) {
25  [%d]=>
26  string(3) "max"
27}
28