1--TEST--
2Lazy objects: JIT: ASSIGN_OBJ_OP with unknown prop info untyped
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?>
34--EXPECTF--
35string(11) "initializer"
36object(C)#%d (2) {
37  ["a":"C":private]=>
38  int(2)
39  ["b"]=>
40  int(2)
41}
42string(11) "initializer"
43object(C)#%d (2) {
44  ["a":"C":private]=>
45  int(2)
46  ["b"]=>
47  int(2)
48}
49