3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler( static fn (int $errno, string $errstr): bool => $errstr === 'Trying to access array offset on value of type null' ); echo null[1]; echo "foo"[4];
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Warning: Trying to access array offset on null in /in/SgZ7f0 on line 8 Warning: Uninitialized string offset 4 in /in/SgZ7f0 on line 9
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30
Warning: Uninitialized string offset 4 in /in/SgZ7f0 on line 9

preferences:
71.71 ms | 1116 KiB | 4 Q