[php-src] PR #17389: sapi/cli: Don't set ini-settings mid-expression in interactive shell
| From: | ReimarPB | Date: | Mon, 06 Jan 2025 21:20:21 +0000 |
| Subject: | [php-src] PR #17389: sapi/cli: Don't set ini-settings mid-expression in interactive shell | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30285@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17389
Author: ReimarPB
This fixes an issue in the interactive shell (
php -a) where the prompt character shown
after setting an ini-setting while in the middle of an expression (having pressed enter after an
unfinished quote/bracket) would always incorrectly be >.
Here is a demonstration of the current behavior:
```
Interactive shell
php > $str = "
php " #key=value
php >
```
Notice how the last prompt is php > although it should be php "
since we are still in the middle of a string.
This PR changes such that the setting is just ignored as long as your expression is unfinished:
```
Interactive shell
php > $str = "
php " #key=value
php " ";
php > echo $str;
#key=value
php >
```