Annotation of embedaddon/php/Zend/tests/traits/language011.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Aliasing on conflicting method should not cover up conflict.
        !             3: --FILE--
        !             4: <?php
        !             5: error_reporting(E_ALL);
        !             6: 
        !             7: trait Hello {
        !             8:    public function sayHello() {
        !             9:      echo 'Hello';
        !            10:    }
        !            11: }
        !            12: 
        !            13: trait World {
        !            14:    public function sayHello() {
        !            15:      echo ' World!';
        !            16:    }
        !            17: }
        !            18: 
        !            19: 
        !            20: class MyClass {
        !            21:    use Hello, World { sayHello as sayWorld; }
        !            22: }
        !            23: 
        !            24: $o = new MyClass();
        !            25: $o->sayHello();
        !            26: $o->sayWorld();
        !            27: 
        !            28: ?>
        !            29: --EXPECTF--    
        !            30: Fatal error: Trait method sayHello has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>