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.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14, 8.4.1
Array ( ) Deprecated: file(): Passing null to parameter #1 ($filename) of type string is deprecated in /in/0Pgfo on line 4 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 8.0.0 - 8.0.30
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.33, 7.4.0 - 7.4.33
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

preferences:
41.98 ms | 410 KiB | 5 Q