bug47836.phpt 349 B

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