Merge pull request #821 from glebocki/patch-1

Changed CLI name variable signature from optional to argument
This commit is contained in:
Josh Lockhart
2019-08-17 11:03:22 -04:00
committed by GitHub

View File

@@ -27,7 +27,7 @@ Let's write a simple "Hello, $name" CLI program. To try it out, create a file na
{% highlight php %}
<?php
if ($argc !== 2) {
echo "Usage: php hello.php [name].\n";
echo "Usage: php hello.php <name>.\n";
exit(1);
}
$name = $argv[1];
@@ -45,7 +45,7 @@ To run our script, above, from the command line:
{% highlight console %}
> php hello.php
Usage: php hello.php [name]
Usage: php hello.php <name>
> php hello.php world
Hello, world
{% endhighlight %}