xref: /PHP-7.2/ext/pcntl/tests/pcntl_exec_2.phpt (revision 17ccbeec)
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(getenv("FOO"));
14	exit;
15}
16echo "ok\n";
17pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), array('-n', __FILE__), array(
18	"PCNTL_EXEC_TEST_IS_CHILD" => "1",
19	"FOO" => "BAR",
20	1 => "long")
21);
22
23echo "nok\n";
24?>
25--EXPECT--
26ok
27string(3) "BAR"
28