3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function ra($test, $boo, $foo, $bar) { $wl = array('test', 'boo', 'foo', 'bar'); $arr = array(); foreach ($wl as $val) { $arr[$val] = $$val; } var_dump($arr); } ra('test','foo', 'bar');
based on uh22k
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function ra(), 3 passed in /in/l3rCa on line 12 and exactly 4 expected in /in/l3rCa:3 Stack trace: #0 /in/l3rCa(12): ra('test', 'foo', 'bar') #1 {main} thrown in /in/l3rCa on line 3
Process exited with code 255.
Output for 5.3.19 - 7.0.20
Warning: Missing argument 4 for ra(), called in /in/l3rCa on line 12 and defined in /in/l3rCa on line 3 Notice: Undefined variable: bar in /in/l3rCa on line 7 array(4) { ["test"]=> string(4) "test" ["boo"]=> string(3) "foo" ["foo"]=> string(3) "bar" ["bar"]=> NULL }