1--TEST--
2Test array_push() function : error conditions - max int value as key
3--FILE--
4<?php
5/* Prototype  : int array_push(array $stack, mixed $var [, mixed $...])
6 * Description: Pushes elements onto the end of the array
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Use PHP's maximum integer value as array key
12 * then try and push new elements onto the array
13 */
14
15echo "*** Testing array_push() : error conditions ***\n";
16
17$array = array(PHP_INT_MAX => 'max');
18
19var_dump(array_push($array, 'new'));
20var_dump($array);
21
22echo "Done";
23?>
24
25--EXPECTF--
26*** Testing array_push() : error conditions ***
27
28Warning: array_push(): Cannot add element to the array as the next element is already occupied in %s on line %d
29bool(false)
30array(1) {
31  [%d]=>
32  string(3) "max"
33}
34Done