php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #55086
Patch bug55086.phpt revision 2011-07-01 20:33 UTC by pierrick@php.net
Patch 55086-v1.diff revision 2011-06-30 17:30 UTC by pierrick at webstart dot fr

Patch bug55086.phpt for Scripting Engine problem Bug #55086

Patch version 2011-07-01 20:33 UTC

Return to Bug #55086 | Download this patch
Patch Revisions:

Developer: pierrick@php.net

Index: Zend/tests/traits/bug55086.phpt
===================================================================
--- Zend/tests/traits/bug55086.phpt	(revision 0)
+++ Zend/tests/traits/bug55086.phpt	(revision 0)
@@ -0,0 +1,36 @@
+--TEST--
+Bug #55086 (Namespace alias does not work inside trait's use block)
+--FILE--
+<?php
+namespace N1 {
+
+    trait T1 {
+        public function hello() { return 'hello from t1'; }
+    }
+
+    trait T2 {
+        public function hello() { return 'hello from t2'; }
+    }
+
+}
+namespace N2 {
+    use N1\T1;
+    use N1\T2;
+    class A {
+        use T1, T2 {
+            T1::hello insteadof T2;
+            T1::hello as foo;
+        }
+    }
+    $a = new A;
+    echo $a->hello(), PHP_EOL;
+    echo $a->foo(), PHP_EOL;
+    try {
+    } catch(namespace \Foo $e)
+    {
+    }
+}
+?>
+--EXPECT--
+hello from t1
+hello from t1

Property changes on: Zend/tests/traits/bug55086.phpt
___________________________________________________________________
Added: svn:executable
   + *

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 22:01:31 2024 UTC