summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/language009.phpt
blob: b44dfa661ac2702cf95215f1660cb87130a93569 (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--
In instead definitions all trait whose methods are meant to be hidden can be listed.
--FILE--
<?php
error_reporting(E_ALL);

trait A {
   public function foo() {
     echo 'a';
   }
}

trait B {
   public function foo() {
     echo 'b';
   }
}

trait C {
   public function foo() {
     echo 'c';
   }
}

class MyClass {
    use C, A, B {
		B::foo insteadof A, C;
	}
}

$t = new MyClass;
$t->foo();

?>
--EXPECTF--
b