xref: /PHP-8.4/ext/opcache/tests/jit/gh12262.phpt (revision 54452b48)
1--TEST--
2GH-12262: Tracing JIT assertion crash when using phpstan
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_hot_func=2
8--FILE--
9<?php
10class C {
11}
12trait T {
13    public function equal(C $type): bool {
14        return $type instanceof self && $this->value === $type->value;
15    }
16}
17class C1 extends C {
18    use T;
19    public function __construct(private int $value) {
20    }
21}
22class C2 extends C {
23    use T;
24	public function __construct(private string $value) {
25	}
26}
27$x = new C1(1);
28var_dump($x->equal($x));
29var_dump($x->equal($x));
30var_dump($x->equal($x));
31
32$a = new C2("aaa");
33var_dump($a->equal($a));
34var_dump($a->equal($a));
35var_dump($a->equal($a));
36?>
37--EXPECT--
38bool(true)
39bool(true)
40bool(true)
41bool(true)
42bool(true)
43bool(true)
44