mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
35 lines
522 B
PHP
35 lines
522 B
PHP
--TEST--
|
|
Bug #48215 - parent::method() calls __construct
|
|
--FILE--
|
|
<?php
|
|
class A
|
|
{
|
|
public function __construct() {
|
|
echo __METHOD__ . "\n";
|
|
}
|
|
protected function A()
|
|
{
|
|
echo __METHOD__ . "\n";
|
|
}
|
|
}
|
|
class B extends A
|
|
{
|
|
public function __construct() {
|
|
echo __METHOD__ . "\n";
|
|
parent::__construct();
|
|
}
|
|
public function A()
|
|
{
|
|
echo __METHOD__ . "\n";
|
|
parent::A();
|
|
}
|
|
}
|
|
$b = new B();
|
|
$b->A();
|
|
?>
|
|
--EXPECT--
|
|
B::__construct
|
|
A::__construct
|
|
B::A
|
|
A::A
|