xref: /PHP-8.3/Zend/tests/bug60536_003.phpt (revision 72c3eded)
1--TEST--
2Properties should be initialized correctly (relevant to #60536)
3--FILE--
4<?php
5
6class BaseWithPropA {
7  private $hello = 0;
8}
9
10trait AHelloProperty {
11  private $hello = 0;
12}
13
14class BaseWithTPropB {
15    use AHelloProperty;
16}
17
18class SubclassA extends BaseWithPropA {
19    use AHelloProperty;
20}
21
22class SubclassB extends BaseWithTPropB {
23    use AHelloProperty;
24}
25
26$a = new SubclassA;
27var_dump($a);
28
29$b = new SubclassB;
30var_dump($b);
31
32?>
33--EXPECTF--
34object(SubclassA)#%d (2) {
35  ["hello":"BaseWithPropA":private]=>
36  int(0)
37  ["hello":"SubclassA":private]=>
38  int(0)
39}
40object(SubclassB)#%d (2) {
41  ["hello":"BaseWithTPropB":private]=>
42  int(0)
43  ["hello":"SubclassB":private]=>
44  int(0)
45}
46