xref: /PHP-5.5/ext/pcntl/tests/pcntl_exec_2.phpt (revision a03f0943)
1--TEST--
2pcntl_exec() 2
3--SKIPIF--
4<?php
5
6if (!extension_loaded("pcntl")) print "skip";
7if (!getenv("TEST_PHP_EXECUTABLE") || !is_executable(getenv("TEST_PHP_EXECUTABLE"))) die("skip TEST_PHP_EXECUTABLE not set");
8
9?>
10--FILE--
11<?php
12if (getenv("PCNTL_EXEC_TEST_IS_CHILD")) {
13	var_dump((binary)getenv("FOO"));
14	exit;
15}
16echo "ok\n";
17pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), array('-n', __FILE__), array(
18	b"PCNTL_EXEC_TEST_IS_CHILD" => b"1",
19	b"FOO" => b"BAR",
20	1 => b"long")
21);
22
23echo "nok\n";
24?>
25--EXPECT--
26ok
27string(3) "BAR"
28