diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index 84b261db34283..5ca77bc3c6789 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -343,6 +343,7 @@ static int cli_is_valid_code(char *code, size_t len, zend_string **prompt) /* {{ case ' ': case '\t': case '\'': + case '"': break; case '\r': case '\n': diff --git a/sapi/cli/tests/gh14189.phpt b/sapi/cli/tests/gh14189.phpt new file mode 100644 index 0000000000000..5c0a8b252bf73 --- /dev/null +++ b/sapi/cli/tests/gh14189.phpt @@ -0,0 +1,44 @@ +--TEST-- +GH-14189 (PHP Interactive shell input state incorrectly handles quoted heredoc literals.) +--EXTENSIONS-- +readline +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Interactive shell + +php > $test = <<<"EOF" +<<< > foo +<<< > bar +<<< > baz +<<< > EOF; +php > echo $test; +foo +bar +baz +php > exit