3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = array(); $foo[PHP_INT_MAX] = 'hello'; $foo[] = 'world'; $foo[] = '!'; var_dump($foo);
based on 69mif
Output for 5.2.10 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Warning: Cannot add element to the array as the next element is already occupied in /in/ZRu6e on line 6 Warning: Cannot add element to the array as the next element is already occupied in /in/ZRu6e on line 7 array(1) { [9223372036854775807]=> string(5) "hello" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.4.0 - 4.4.9, 5.0.5 - 5.2.9
array(3) { [9223372036854775807]=> string(5) "hello" [-9223372036854775808]=> string(5) "world" [-9223372036854775807]=> string(1) "!" }
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.4
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/ZRu6e on line 5 array(3) { ["PHP_INT_MAX"]=> string(5) "hello" [0]=> string(5) "world" [1]=> string(1) "!" }