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--EXPECTF-- 25*** Testing array_push() : error conditions *** 26 27Warning: array_push(): Cannot add element to the array as the next element is already occupied in %s on line %d 28bool(false) 29array(1) { 30 [%d]=> 31 string(3) "max" 32} 33Done 34