xref: /PHP-7.3/sapi/phpdbg/tests/run_002.phpt (revision 417a8ef6)
1--TEST--
2Stdin and escaped args being passed to run command
3--CLEAN--
4<?php
5@unlink("run_002_tmp.fixture");
6?>
7--PHPDBG--
8ev file_put_contents("run_002_tmp.fixture", "stdin\ndata")
9b 6
10r <run_002_tmp.fixture
11r arg1 '_ \' arg2 "' < run_002_tmp.fixture
12y
13c
14q
15--EXPECTF--
16[Successful compilation of %s]
17prompt> 10
18prompt> [Breakpoint #0 added at %s:6]
19prompt> array(1) {
20  [0]=>
21  string(%d) "%s"
22}
23string(10) "stdin
24data"
25[Breakpoint #0 at %s:6, hits: 1]
26>00006: echo "ok\n";
27 00007:
28prompt> Do you really want to restart execution? (type y or n): array(3) {
29  [0]=>
30  string(%d) "%s"
31  [1]=>
32  string(4) "arg1"
33  [2]=>
34  string(10) "_ ' arg2 ""
35}
36string(10) "stdin
37data"
38[Breakpoint #0 at %s:6, hits: 1]
39>00006: echo "ok\n";
40 00007:
41prompt> ok
42[Script ended normally]
43prompt>
44--FILE--
45<?php
46
47var_dump($argv);
48var_dump(stream_get_contents(STDIN));
49
50echo "ok\n";
51