3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function argv() { $_GLOBALS["argv"] = func_get_args(); $_GLOBALS["argc"] = count($_SERVER["argv"]); } var_dump($argv); argv("script.php", "-fvalue", "-h"); var_dump($argv); $options = getopt("f:hp:"); var_dump($options);
Output for 4.3.2 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
array(1) { [0]=> string(9) "/in/1Et1X" } array(1) { [0]=> string(9) "/in/1Et1X" } array(0) { }
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: argv in /in/1Et1X on line 9 NULL Notice: Undefined variable: argv in /in/1Et1X on line 13 NULL array(0) { }