xref: /PHP-8.0/Zend/tests/traits/bugs/alias01.phpt (revision 782352c5)
1--TEST--
2Aliases are applied to the correct methods, and only to them.
3--FILE--
4<?php
5trait T1 {
6  function m1() { echo "T:m1\n"; }
7  function m2() { echo "T:m2\n"; }
8}
9
10class C1 {
11  use T1 { m1 as a1; }
12}
13
14$o = new C1;
15$o->m1();
16$o->a1();
17$o->m2();
18$o->a2();
19
20?>
21--EXPECTF--
22T:m1
23T:m1
24T:m2
25
26Fatal error: Uncaught Error: Call to undefined method C1::a2() in %s:%d
27Stack trace:
28#0 {main}
29  thrown in %s on line %d
30