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.26, 8.4.1 - 8.4.13
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.33, 8.2.0 - 8.2.29
Warning: Uninitialized string offset 4 in /in/SgZ7f0 on line 9

preferences:
74.59 ms | 407 KiB | 5 Q