3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f(int $a, int $b = null, int $c = null) { error_log(json_encode([$a, $b, $c])); error_log(json_encode(func_get_args())); } function changeF($code, $str) { preg_match('/^Argument (\\d+) /', $str, $m); $i = $m[1]-1; $bt = debug_backtrace(null, 2); ++$bt[1]['args'][$i]; return true; } set_error_handler('changeF', E_ALL); f(3, 2, 1);

preferences:
34.72 ms | 402 KiB | 5 Q