xref: /PHP-8.2/sapi/cli/tests/010.phpt (revision c5401854)
1--TEST--
2executing a file with -F
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$filename = __DIR__."/010.test.php";
16$filename_txt = __DIR__."/010.test.txt";
17
18$code = '
19<?php
20var_dump(fread(STDIN, 10));
21?>
22';
23
24file_put_contents($filename, $code);
25
26$txt = '
27test
28hello';
29
30file_put_contents($filename_txt, $txt);
31
32var_dump(`cat "$filename_txt" | "$php" -n -F "$filename"`);
33
34?>
35--CLEAN--
36<?php
37@unlink(__DIR__."/010.test.php");
38@unlink(__DIR__."/010.test.txt");
39?>
40--EXPECT--
41string(25) "
42string(10) "test
43hello"
44"
45