1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00
Files
archived-php-src/Zend/tests/traits/bug76773.phpt
T
Máté Kocsis 7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00

34 lines
454 B
PHP

--TEST--
Bug #76773 (Traits used on the parent are ignored for child classes)
--FILE--
<?php
trait MyTrait
{
public function hello()
{
echo __CLASS__, "\n";
if (\is_callable(array('parent', __FUNCTION__))) {
parent::hello();
}
}
}
class ParentClass
{
use MyTrait;
}
class ChildClass extends ParentClass
{
use MyTrait;
}
$c = new ChildClass();
$c->hello();
?>
--EXPECT--
ChildClass
ParentClass