3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [PHP_INT_MAX => 1]; $array[] = 2; // Cannot add element to the array as the next element is already occupied
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught Error: Cannot add element to the array as the next element is already occupied in /in/aN7pP:4 Stack trace: #0 {main} thrown in /in/aN7pP on line 4
Process exited with code 255.

preferences:
49.92 ms | 855 KiB | 4 Q