3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function phpRocks($default = "default", $noDefault) { var_dump($default); var_dump($noDefault); } phpRocks("hello");
based on 7tu0e
Output for 7.1.0 - 7.3.0beta1
Fatal error: Uncaught ArgumentCountError: Too few arguments to function phpRocks(), 1 passed in /in/cAjkL on line 8 and exactly 2 expected in /in/cAjkL:2 Stack trace: #0 /in/cAjkL(8): phpRocks('hello') #1 {main} thrown in /in/cAjkL on line 2
Process exited with code 255.
Output for hhvm-3.22.0
Warning: phpRocks() expects exactly 2 parameters, 1 given in /in/cAjkL on line -1 string(5) "hello" Notice: Undefined variable: noDefault in /in/cAjkL on line -1 NULL
Output for hhvm-3.18.5 - 3.21.3
Warning: phpRocks() expects exactly 2 parameters, 1 given in /in/cAjkL on line 4 string(5) "hello" Notice: Undefined variable: noDefault in /in/cAjkL on line 5 NULL
Output for 5.6.0 - 5.6.30
Warning: Missing argument 2 for phpRocks(), called in /in/cAjkL on line 8 and defined in /in/cAjkL on line 2 string(5) "hello" Notice: Undefined variable: noDefault in /in/cAjkL on line 5 NULL