Skip to content

Commit 2dd463f

Browse files
committed
Fix GH-20871: Improve error messages for invalid -d command-line options
1 parent 10591c9 commit 2dd463f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

sapi/cli/tests/gh20871.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,21 @@ $php = getenv('TEST_PHP_EXECUTABLE_ESCAPED');
99
exec("$php -d 'foo=bar=asd' -r \"echo 'hello' . PHP_EOL;\" 2>&1", $output, $exit_code);
1010
print_r($output);
1111

12+
echo "\n";
13+
14+
exec("$php -d 'foo=bar!asd' -r \"echo 'world' . PHP_EOL;\" 2>&1", $output2, $exit_code2);
15+
print_r($output2);
16+
1217
?>
1318
--EXPECTF--
1419
Array
1520
(
1621
[0] => PHP: syntax error, unexpected '=' in -d option on line 0
1722
[1] => hello
1823
)
24+
25+
Array
26+
(
27+
[0] => PHP: syntax error, unexpected '!' in -d option on line 0
28+
[1] => world
29+
)

0 commit comments

Comments
 (0)