mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
7a9e0fb39b
The bug was introduced in c6b75f9328
39 lines
557 B
PHP
39 lines
557 B
PHP
--TEST--
|
|
GH-14009: Traits inherit prototype
|
|
--FILE--
|
|
<?php
|
|
|
|
trait T {
|
|
private function test($s) {
|
|
echo $s . " -> ". __CLASS__ . "::" . __METHOD__ . "\n";
|
|
}
|
|
}
|
|
|
|
class A {
|
|
use T;
|
|
public function foo() {
|
|
$this->test(__METHOD__);
|
|
}
|
|
public function bar() {
|
|
$this->test(__METHOD__);
|
|
}
|
|
}
|
|
|
|
class B extends A {
|
|
use T;
|
|
public function foo() {
|
|
$this->test(__METHOD__);
|
|
}
|
|
}
|
|
|
|
(new A)->foo();
|
|
(new A)->bar();
|
|
(new B)->foo();
|
|
(new B)->bar();
|
|
?>
|
|
--EXPECT--
|
|
A::foo -> A::T::test
|
|
A::bar -> A::T::test
|
|
B::foo -> B::T::test
|
|
A::bar -> A::T::test
|