mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
36 lines
521 B
Plaintext
36 lines
521 B
Plaintext
|
--TEST--
|
||
|
Bug #55424 (Method got missing from class when a trait defined an abstract method to express a requirement)
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
trait ATrait
|
||
|
{
|
||
|
function setRequired()
|
||
|
{
|
||
|
$this->setAttribute();
|
||
|
}
|
||
|
|
||
|
abstract function setAttribute();
|
||
|
}
|
||
|
|
||
|
class Base
|
||
|
{
|
||
|
function setAttribute() { }
|
||
|
}
|
||
|
|
||
|
class MyClass extends Base
|
||
|
{
|
||
|
use ATrait;
|
||
|
}
|
||
|
|
||
|
$i = new Base();
|
||
|
$i->setAttribute();
|
||
|
|
||
|
$t = new MyClass();
|
||
|
/* setAttribute used to disappear for no good reason. */
|
||
|
$t->setRequired();
|
||
|
echo 'DONE';
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
DONE
|