blob: 590949c2f6bdac17ce9f8dec4cfcc4c1b7277f8c (
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
|