Skip to content

parsing arguments from string like shell

Thomas Flori requested to merge github/fork/tflori/fix-parser into master

Created by: tflori

It should accept strings and make the same from it like shell is doing. just splitting by space is not correct.

php -r "var_dump(\$_SERVER['argv']);" -- what the heck
# ["what","the","heck"]
php -r "var_dump(\$_SERVER['argv']);" -- "what the heck"
# ["what the heck"]
php -r "var_dump(\$_SERVER['argv']);" -- 'what the heck'
# ["what the heck"]
php -r "var_dump(\$_SERVER['argv']);" -- 'what the "'
# ["what the ""]
php -r "var_dump(\$_SERVER['argv']);" -- "what the '"
# ["what the '"]

Merge request reports