Changed CLI name variable signature from optional to argument

This commit is contained in:
Przemysław Głębocki
2019-04-16 12:09:06 +02:00
committed by GitHub
parent e8c464dcea
commit b4d2228b8e

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 %}