3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $a[(object)null] = 1; } catch (Throwable $e) { print_r($e->getTrace()); } try { file(null); } catch (Throwable $e) { print_r($e->getTrace()); } try { file(); } catch (Throwable $e) { print_r($e->getTrace()); }
Output for 8.0.0 - 8.0.2
Array ( ) Array ( [0] => Array ( [file] => /in/0Pgfo [line] => 4 [function] => file [args] => Array ( [0] => ) ) ) Array ( [0] => Array ( [file] => /in/0Pgfo [line] => 5 [function] => file [args] => Array ( ) ) )
Output for 7.3.0 - 7.3.27, 7.4.0 - 7.4.15
Warning: Illegal offset type in /in/0Pgfo on line 3 Warning: file(): Filename cannot be empty in /in/0Pgfo on line 4 Warning: file() expects at least 1 parameter, 0 given in /in/0Pgfo on line 5