1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Files
archived-php-src/Zend/tests/traits/bugs/alias01.phpt
T
2015-05-17 17:31:43 -05:00

30 lines
414 B
PHP

--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 Error: Call to undefined method C1::a2() in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d