summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/conflict001.phpt
blob: 16dd6fc2d5317019abd4b66de7b71379547fd852 (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
--TEST--
Method conflict in traits
--FILE--
<?php
error_reporting(E_ALL);

trait THello1 {
  private function hello() {
    echo 'Hello';
  }
}

trait THello2 {
  private function hello() {
    echo 'Hello';
  }
}

class TraitsTest {
    use THello1;
    use THello2;
}
?>
--EXPECTF--
Fatal error: Trait method THello2::hello has not been applied as TraitsTest::hello, because of collision with THello1::hello in %s on line %d