File: 012-2.phpt

package info (click to toggle)
php8.4 8.4.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 211,276 kB
  • sloc: ansic: 1,176,142; php: 35,419; sh: 11,964; cpp: 7,208; pascal: 4,951; javascript: 3,091; asm: 2,817; yacc: 2,411; makefile: 696; xml: 446; python: 301; awk: 148
file content (54 lines) | stat: -rw-r--r-- 1,508 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--TEST--
more invalid arguments and error messages
--EXTENSIONS--
readline
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
<?php

$php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');

// -r : behavior = CLI_DIRECT
// -F / -R / -B / -E : behavior = PROCESS_STDIN
// -l : behavior = LINT
// -s : behavior = HIGHLIGHT
// -w : behavior = STRIP

var_dump(`$php -n -r "echo 1;" -F some.php`);
var_dump(`$php -n -r "echo 2;" -f some.php`);
var_dump(`$php -n -r "echo 3;" -l`); // ignores linting
var_dump(`$php -n -r "echo 4;" -R some.php`);
var_dump(`$php -n -r "echo 5;" -B ""`);
var_dump(`$php -n -a -B ""`);
var_dump(`$php -n -r "echo 6;" -E ""`);
var_dump(`$php -n -a -E ""`);
var_dump(`$php -n -r "echo 7;" -s`);
var_dump(`$php -n -r "echo 8;" -w`);
var_dump(`$php -n -l -r "echo 9;"`);

echo "Done\n";
?>
--EXPECT--
string(57) "Either execute direct code, process stdin or use a file.
"
string(57) "Either execute direct code, process stdin or use a file.
"
string(1) "3"
string(57) "Either execute direct code, process stdin or use a file.
"
string(57) "Either execute direct code, process stdin or use a file.
"
string(57) "Either execute direct code, process stdin or use a file.
"
string(57) "Either execute direct code, process stdin or use a file.
"
string(57) "Either execute direct code, process stdin or use a file.
"
string(42) "Source highlighting only works for files.
"
string(39) "Source stripping only works for files.
"
string(57) "Either execute direct code, process stdin or use a file.
"
Done