1--TEST--
2Test type inference of class consts - reference by parent
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.opt_debug_level=0x20000
8opcache.preload=
9zend_test.observer.enabled=0
10--EXTENSIONS--
11opcache
12--FILE--
13<?php
14
15class Test1 {
16    public const FOO = 42;
17    public final const BAR = 42;
18    public const int BAZ = 42;
19}
20
21final class Test2 extends Test1 {
22    public function getParentFoo(): int {
23        return parent::FOO;
24    }
25
26    public function getParentBar(): int {
27        return parent::BAR;
28    }
29
30    public function getParentBaz(): int {
31        return parent::BAZ;
32    }
33}
34
35?>
36--EXPECTF--
37$_main:
38     ; (lines=1, args=0, vars=0, tmps=0)
39     ; (after optimizer)
40     ; %s
410000 RETURN int(1)
42
43Test2::getParentFoo:
44     ; (lines=1, args=0, vars=0, tmps=0)
45     ; (after optimizer)
46     ; %s
470000 RETURN int(42)
48
49Test2::getParentBar:
50     ; (lines=1, args=0, vars=0, tmps=0)
51     ; (after optimizer)
52     ; %s
530000 RETURN int(42)
54
55Test2::getParentBaz:
56     ; (lines=1, args=0, vars=0, tmps=0)
57     ; (after optimizer)
58     ; %s
590000 RETURN int(42)
60