summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/bugs/alias01.phpt
blob: 7d0dfed1871b552fcd5b90d3a8b211bd7351b7dd (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
--TEST--
Aliases are applied to the correct methods, and only to them.
--FILE--
<?php
trait T1 {
  function m1() { echo "T:m1\n"; }
  function m2() { echo "T:m2\n"; }
}

class C1 { 
  use T1 { m1 as a1; }
}

$o = new C1;
$o->m1();
$o->a1();
$o->m2();
$o->a2();

?>
--EXPECTF--
T:m1
T:m1
T:m2

Fatal error: Uncaught EngineException: Call to undefined method C1::a2() in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d