xref: /PHP-7.3/sapi/cli/tests/015.phpt (revision fd08f062)
1--TEST--
2CLI long options
3--SKIPIF--
4<?php
5include "skipif.inc";
6if (substr(PHP_OS, 0, 3) == 'WIN') {
7	die ("skip not for Windows");
8}
9?>
10--FILE--
11<?php
12
13$php = getenv('TEST_PHP_EXECUTABLE');
14
15
16echo `"$php" -n --version | grep built:`;
17echo `echo "<?php print_r(\\\$argv);" | "$php" -n -- foo bar baz`, "\n";
18echo `"$php" -n --version foo bar baz | grep built:`;
19echo `"$php" -n --notexisting foo bar baz 2>&1 | grep Usage:`;
20
21echo "Done\n";
22?>
23--EXPECTF--
24PHP %d.%d.%d%s(cli) (built: %s)%s
25Array
26(
27    [0] => Standard input code
28    [1] => foo
29    [2] => bar
30    [3] => baz
31)
32
33PHP %d.%d.%d%s(cli) (built: %s)%s
34Usage: %s [options] [-f] <file> [--] [args...]
35Done
36