xref: /PHP-8.2/Zend/tests/bug33732.phpt (revision 610c7fbe)
1--TEST--
2Bug #33732 (Wrong behavior of constants in class and interface extending)
3--FILE--
4<?php
5interface iA {
6  const cA = "const of iA\n";
7}
8
9class A implements iA {
10}
11
12class B extends A implements iA {
13}
14
15echo iA::cA;
16echo A::cA;
17echo B::cA;
18
19
20interface iA2 {
21    const cA = "const of iA2\n";
22}
23
24interface iB2 extends iA2 {
25}
26
27class A2 implements iA2 {
28}
29
30class B2 extends A2 implements iA2 {
31}
32
33echo iA2::cA;
34echo A2::cA;
35echo iB2::cA;
36echo B2::cA;
37?>
38--EXPECT--
39const of iA
40const of iA
41const of iA
42const of iA2
43const of iA2
44const of iA2
45const of iA2
46