php-src/Zend/tests/traits/bug55424.phpt
Stefan Marr 4a51ea4b81 Bug #55424 Fatal error when calling a method from a trait that is defined in parent class and required by using an abstract method in the trait.
# The method got unconditionally deleted from the class, since it was assumed that we override it, but we did not in case of abstract methods coming from a trait. Thus, dont delete when we try to merge in an abstract method.
2011-08-15 22:16:58 +00:00

36 lines
521 B
PHP

--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