xref: /PHP-8.2/Zend/tests/bug48215.phpt (revision f8d79582)
1--TEST--
2Bug #48215 - parent::method() calls __construct
3--FILE--
4<?php
5class A
6{
7    public function __construct() {
8        echo __METHOD__ . "\n";
9    }
10    protected function A()
11    {
12        echo __METHOD__ . "\n";
13    }
14}
15class B extends A
16{
17    public function __construct() {
18        echo __METHOD__ . "\n";
19        parent::__construct();
20    }
21    public function A()
22    {
23        echo __METHOD__ . "\n";
24        parent::A();
25    }
26}
27$b = new B();
28$b->A();
29?>
30--EXPECT--
31B::__construct
32A::__construct
33B::A
34A::A
35