xref: /PHP-8.4/ext/opcache/tests/jit/recv_003.phpt (revision c16ad918)
1--TEST--
2JIT RECV: slow type check
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.protect_memory=1
8;opcache.jit_debug=257
9--EXTENSIONS--
10opcache
11--FILE--
12<?php
13class A {
14}
15class B extends A {
16}
17class C {
18}
19
20function test(A $x)
21{
22	echo "ok\n";
23}
24
25test(new B);
26test(new C);
27?>
28--EXPECTF--
29ok
30
31Fatal error: Uncaught TypeError: test(): Argument #1 ($x) must be of type A, C given, called in %s:9
32Stack trace:
33#0 %s(15): test(Object(C))
34#1 {main}
35  thrown in %s on line 9
36