[php-src] Issue #9895: Compiled constant expr code must still emit all op execute hooks
| From: | mvorisek | Date: | Sat, 05 Nov 2022 13:45:38 +0000 |
| Subject: | [php-src] Issue #9895: Compiled constant expr code must still emit all op execute hooks | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242754@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9895
Author: mvorisek
### Description
related with https://github.com/sebastianbergmann/php-code-coverage/issues/889
if code can be run on compile time (constant expr), all hooks, used for ex. by coverage libs like
xdebug, must still be called in the same order as if the code was not optimized on compile time
examples:
code with always constant expr:
```
$v2
=
(bool)
1
;
```
the cast operation can be always evaluated/optimized on compile time, but cast operation hook must
be always emit
code with sometimes constant expr:
```
$v3
=
(bool)
AType::OPT
;
```
same as the first example when
AType class was loaded before this example was
included/compiled