xref: /PHP-7.4/sapi/cli/tests/012-2.phpt (revision ded3d984)
1--TEST--
2more invalid arguments and error messages
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7
8$php = getenv('TEST_PHP_EXECUTABLE');
9
10// -r : behavior = CLI_DIRECT
11// -F / -R / -B / -E : behavior = PROCESS_STDIN
12// -l : behavior = LINT
13// -s : behavior = HIGHLIGHT
14// -w : behavior = STRIP
15
16var_dump(`"$php" -n -r "echo 1;" -F some.php`);
17var_dump(`"$php" -n -r "echo 2;" -f some.php`);
18var_dump(`"$php" -n -r "echo 3;" -l`); // ignores linting
19var_dump(`"$php" -n -r "echo 4;" -R some.php`);
20var_dump(`"$php" -n -r "echo 5;" -B ""`);
21var_dump(`"$php" -n -a -B ""`);
22var_dump(`"$php" -n -r "echo 6;" -E ""`);
23var_dump(`"$php" -n -a -E ""`);
24var_dump(`"$php" -n -r "echo 7;" -s`);
25var_dump(`"$php" -n -r "echo 8;" -w`);
26var_dump(`"$php" -n -l -r "echo 9;"`);
27
28echo "Done\n";
29?>
30--EXPECT--
31string(57) "Either execute direct code, process stdin or use a file.
32"
33string(57) "Either execute direct code, process stdin or use a file.
34"
35string(1) "3"
36string(57) "Either execute direct code, process stdin or use a file.
37"
38string(57) "Either execute direct code, process stdin or use a file.
39"
40string(57) "Either execute direct code, process stdin or use a file.
41"
42string(57) "Either execute direct code, process stdin or use a file.
43"
44string(57) "Either execute direct code, process stdin or use a file.
45"
46string(42) "Source highlighting only works for files.
47"
48string(39) "Source stripping only works for files.
49"
50string(57) "Either execute direct code, process stdin or use a file.
51"
52Done
53