3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function argv() { $_SERVER["argv"] = func_get_args(); $_SERVER["argc"] = count($_SERVER["argv"]); } argv("script.php", "-fvalue", "-h"); $argv = $_SERVER["argv"]; var_dump($argv); $options = getopt("f:hp:"); var_dump($options);
Output for 4.3.0 - 7.1.0
array(3) { [0]=> string(10) "script.php" [1]=> string(7) "-fvalue" [2]=> string(2) "-h" } array(0) { }