Annotation of embedaddon/php/Zend/tests/bug55086.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #55086 (Namespace alias does not work inside trait's use block)
                      3: --FILE--
                      4: <?php
                      5: namespace N1 {
                      6: 
                      7:     trait T1 {
                      8:         public function hello() { return 'hello from t1'; }
                      9:     }
                     10: 
                     11:     trait T2 {
                     12:         public function hello() { return 'hello from t2'; }
                     13:     }
                     14: 
                     15: }
                     16: namespace N2 {
                     17:     use N1\T1;
                     18:     use N1\T2;
                     19:     class A {
                     20:         use T1, T2 {
                     21:             T1::hello insteadof T2;
                     22:             T1::hello as foo;
                     23:         }
                     24:     }
                     25:     $a = new A;
                     26:     echo $a->hello(), PHP_EOL;
                     27:     echo $a->foo(), PHP_EOL;
                     28:     try {
                     29:     } catch(namespace \Foo $e)
                     30:     {
                     31:     }
                     32: }
                     33: ?>
                     34: --EXPECT--
                     35: hello from t1
                     36: hello from t1

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