3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [123]; unset($array[0]); if($array === []){ // then $array[] = "x"; // will result in assert([0 => "x"] === $array); }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
Fatal error: Uncaught AssertionError: assert([0 => 'x'] === $array) in /in/5c4fE:8 Stack trace: #0 /in/5c4fE(8): assert(false, 'assert([0 => 'x...') #1 {main} thrown in /in/5c4fE on line 8
Process exited with code 255.
Output for 7.1.0 - 7.1.22, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Warning: assert(): assert([0 => 'x'] === $array) failed in /in/5c4fE on line 8
Output for 5.6.38
Warning: assert(): Assertion failed in /in/5c4fE on line 8

preferences:
120.46 ms | 408 KiB | 5 Q