Skip to content

QA - pcntl_exec - check stringable parameters error #8990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions ext/pcntl/tests/pcntl_exec_004.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--TEST--
pcntl_exec() - Testing error when non-stringable arguments are passed for $args and $env_vars.
--EXTENSIONS--
pcntl
--SKIPIF--
<?php
if (!getenv("TEST_PHP_EXECUTABLE") || !is_executable(getenv("TEST_PHP_EXECUTABLE"))) die("skip TEST_PHP_EXECUTABLE not set");
?>
--FILE--
<?php
try {
pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), ['-n', new stdClass()]);
} catch (Error $error) {
echo $error->getMessage() . "\n";
}

try {
pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), ['-n'], [new stdClass()]);
} catch (Error $error) {
echo $error->getMessage() . "\n";
}
?>
--EXPECT--
Object of class stdClass could not be converted to string
Object of class stdClass could not be converted to string