summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/bug55424.phpt
blob: 5788056096f5cf2e7e64013ce98a0943eeb561f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--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