3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = []; var_dump($x, current($x), current(current($x)));
Output for 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: current(): Argument #1 ($array) must be of type array, false given in /in/5FOpL:5 Stack trace: #0 /in/5FOpL(5): current(false) #1 {main} thrown in /in/5FOpL on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Fatal error: Uncaught TypeError: current(): Argument #1 ($array) must be of type array, bool given in /in/5FOpL:5 Stack trace: #0 /in/5FOpL(5): current(false) #1 {main} thrown in /in/5FOpL on line 5
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: current() expects parameter 1 to be array, bool given in /in/5FOpL on line 5 array(0) { } bool(false) NULL
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Warning: current() expects parameter 1 to be array, boolean given in /in/5FOpL on line 5 array(0) { } bool(false) NULL

preferences:
168.37 ms | 402 KiB | 204 Q