summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/trait_constant_001.phpt
blob: 9521c9267b0964a3410e2deda8af1b039911b86e (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
36
--TEST--
__TRAIT__: Basics, a constant denoiting the trait of definition.
--FILE--
<?php

trait TestTrait {
    public static function test() {
        return __TRAIT__;
    }
}

class Direct {
    use TestTrait;
}

class IndirectInheritance extends Direct {

}

trait TestTraitIndirect {
  use TestTrait;
}

class Indirect {
  use TestTraitIndirect;
}

echo Direct::test()."\n";
echo IndirectInheritance::test()."\n";
echo Indirect::test()."\n";

?>
--EXPECT--
TestTrait
TestTrait
TestTrait