Skip to content

Commit d133cff

Browse files
committed
Merge branch 'PHP-5.5'
2 parents 07a8ca5 + ae71c1d commit d133cff

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

sapi/cli/tests/bug64529.phpt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
--TEST--
2+
Bug #64529 (Ran out of opcode space)
3+
--SKIPIF--
4+
<?php
5+
if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test");
6+
if (!trim(`which expect`)) die "skip no expect installed";
7+
?>
8+
--FILE--
9+
<?php
10+
$expect_executable = trim(`which expect`);
11+
$php_executable = getenv('TEST_PHP_EXECUTABLE');
12+
$script = __DIR__ . "/expect.sh";
13+
14+
if (extension_loaded("readline")) {
15+
$expect_script = <<<SCRIPT
16+
17+
set php_executable [lindex \$argv 0]
18+
19+
spawn \$php_executable -n -a
20+
21+
expect "php >"
22+
23+
send "echo 'hello world';\n"
24+
send "\04"
25+
26+
expect eof
27+
28+
exit
29+
30+
SCRIPT;
31+
32+
} else {
33+
$expect_script = <<<SCRIPT
34+
35+
set php_executable [lindex \$argv 0]
36+
37+
spawn \$php_executable -n -a
38+
39+
expect "Interactive mode enabled"
40+
41+
send "<?php echo 'hello world';\n"
42+
send "\04"
43+
44+
expect eof
45+
46+
exit
47+
48+
SCRIPT;
49+
}
50+
51+
file_put_contents($script, $expect_script);
52+
53+
system($expect_executable . " " . $script . " " . $php_executable);
54+
55+
@unlink($script);
56+
?>
57+
--EXPECTF--
58+
spawn %sphp -n -a
59+
Interactive %s
60+
61+
%secho 'hello world';
62+
hello worl%s

0 commit comments

Comments
 (0)