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