[php-src] Issue #10782: Opcache JIT is generating different observer output
| From: | mvorisek | Date: | Sat, 04 Mar 2023 19:54:54 +0000 |
| Subject: | [php-src] Issue #10782: Opcache JIT is generating different observer output | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-243848@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/10782
Author: mvorisek
### Description
The following code:
```php
--TEST--
Observer: Basic observability of userland methods
--EXTENSIONS--
zend_test
--INI--
zend_test.observer.enabled=1
zend_test.observer.observe_all=1
--FILE--
<?php
class TestClass
{
private function bar()
{
echo 'Bar' . PHP_EOL;
var_dump(array_reduce([1, 2, 3], fn ($a, $b) => $a + $b));
}
public function foo()
{
echo 'Foo' . PHP_EOL;
$this->bar();
}
}
$test = new TestClass();
$test->foo();
$test->foo();
$test->foo();
echo 'DONE' . PHP_EOL;
?>
```
Resulted in this output:
<!-- init TestClass::{closure}() --> shown 3x
But I expected this output instead:
<!-- init TestClass::{closure}() --> shown only once (as when run without opcache
JIT)
CI: https://github.com/php/php-src/actions/runs/4332385117/jobs/7564838868#step:10:156
/cc @dstogov
### PHP Version
master with opcache JIT
### Operating System
any