Skip to content

Commit 492f9c6

Browse files
authored
QA - pcntl_exec - check stringable parameters error
Closes GH-8990.
1 parent 9f8e518 commit 492f9c6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

ext/pcntl/tests/pcntl_exec_004.phpt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
pcntl_exec() - Testing error when non-stringable arguments are passed for $args and $env_vars.
3+
--EXTENSIONS--
4+
pcntl
5+
--SKIPIF--
6+
<?php
7+
if (!getenv("TEST_PHP_EXECUTABLE") || !is_executable(getenv("TEST_PHP_EXECUTABLE"))) die("skip TEST_PHP_EXECUTABLE not set");
8+
?>
9+
--FILE--
10+
<?php
11+
try {
12+
pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), ['-n', new stdClass()]);
13+
} catch (Error $error) {
14+
echo $error->getMessage() . "\n";
15+
}
16+
17+
try {
18+
pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), ['-n'], [new stdClass()]);
19+
} catch (Error $error) {
20+
echo $error->getMessage() . "\n";
21+
}
22+
?>
23+
--EXPECT--
24+
Object of class stdClass could not be converted to string
25+
Object of class stdClass could not be converted to string

0 commit comments

Comments
 (0)