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