diff options
author | Tyson Andre <tysonandre775@hotmail.com> | 2020-09-06 09:43:09 -0400 |
---|---|---|
committer | Tyson Andre <tysonandre775@hotmail.com> | 2020-09-06 10:40:26 -0400 |
commit | 1fc961e2de866ad426ce83dae760605599934673 (patch) | |
tree | 15fe11591ee950ce69bb17c1a61585c9a7ed3675 /sapi/phpdbg/phpdbg_prompt.c | |
parent | 9439ca53227b23e9a0eb0173c80f712ed480fdd8 (diff) | |
download | php-git-1fc961e2de866ad426ce83dae760605599934673.tar.gz |
Improve handling of `#[` attributes in `php -a`
`php -a` treats lines starting with `#` as comments when deciding if
the provided statement is valid.
So it passed `#[MyAttr]` to the parser after the user hits enter,
causing a syntax error for multi-line statements..
With this patch, the following snippet is parsed correctly
```
php > #[Attr]
php > function x() { }
php > var_export((new ReflectionFunction('x'))->getAttributes()[0]->getName());
'Attr'
```
Followup to GH-6085
Closes GH-6086
Diffstat (limited to 'sapi/phpdbg/phpdbg_prompt.c')
0 files changed, 0 insertions, 0 deletions