1--TEST--
2Lazy objects: JIT: ASSIGN_OBJ_OP with unknown prop info
3--FILE--
4<?php
5
6class C {
7    // Private prop so that prop_info is not inferred
8    private int $a;
9    public int $b;
10    function __construct() {
11        $this->a = 1;
12        $this->b = 2;
13    }
14    function test(object $obj) {
15        $obj->a += 1;
16    }
17}
18
19$reflector = new ReflectionClass(C::class);
20
21for ($i = 0; $i < 2; $i++) {
22    $obj = $reflector->newLazyGhost(function ($obj) {
23        var_dump("initializer");
24        $obj->__construct();
25    });
26    // Call via reflection to avoid inlining.
27    // - test() handlers are executed once, and prime the runtime cache
28    // - On subsequent calls, the JIT'ed code is used, and we enter the valid runtime cache path
29    $reflector->getMethod('test')->invoke($obj, $obj);
30    var_dump($obj);
31}
32
33--EXPECTF--
34string(11) "initializer"
35object(C)#%d (2) {
36  ["a":"C":private]=>
37  int(2)
38  ["b"]=>
39  int(2)
40}
41string(11) "initializer"
42object(C)#%d (2) {
43  ["a":"C":private]=>
44  int(2)
45  ["b"]=>
46  int(2)
47}
48