3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = []; $x[] = 1; $x[] += 2; $x[] ??= 3; $x[] *= 4; $x[] **= 5; $x[] |= 6; print_r($x); ?>
Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.4
Fatal error: Cannot use [] for reading in /in/0WDiL on line 6
Process exited with code 255.

preferences:
149.55 ms | 1295 KiB | 6 Q