#!/www/server/bin/php -qC "blah gnaber", " (umlaute)" => "pre üäpost"] as $variant => $testarg) { getopt_ok(['-a', $testarg], $testarg, "Short version" . $variant); getopt_ok(['--argument', $testarg], $testarg, "Long version with space" . $variant); getopt_ok(["--argument=$testarg"], $testarg, "Long version with equal" . $variant); } $_SERVER['argv'] = ['doesnotexist.php', '-0']; $zero_opts = it::getopt($GLOBALS['usage']); ok($zero_opts['zero'], '-0');