]> granicus.if.org Git - php/commitdiff
Goodbye namespaces
authorMarcus Boerger <helly@php.net>
Sat, 7 Jun 2003 00:57:07 +0000 (00:57 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 7 Jun 2003 00:57:07 +0000 (00:57 +0000)
tests/classes/inheritance_002.phpt

index 41358928bfa15bfb582a4416c73cfbca5dc7500f..0d355d85511c2ba6b141ca6e074fb13bbdd2ca42 100755 (executable)
@@ -4,73 +4,65 @@ Constructor precedence
 <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
 --FILE--
 <?php
-  namespace php4 {
-    class Base {
-      function Base() {
-        var_dump('Base constructor');
-      }
-    }
-
-    class Child extends Base {
-      function Child() {
-        var_dump('Child constructor');
-        parent::Base();
-      }
-    }
+class Base_php4 {
+  function Base_php4() {
+    var_dump('Base constructor');
   }
-  
-  namespace php5 {
-    class Base {
-      function __construct() {
-        var_dump('Base constructor');
-      }
-      
-      function Base() {
-        var_dump('I should not be called');
-      }
-    }
+}
 
-    class Child extends Base {
-      function __construct() {
-        var_dump('Child constructor');
-        parent::__construct();
-      }
-      
-      function Child() {
-        var_dump('I should not be called');
-      }
-    }
+class Child_php4 extends Base_php4 {
+  function Child_php4() {
+    var_dump('Child constructor');
+    parent::Base_php4();
   }
+}
 
-  namespace mixed1 {
-    class Child extends php4::Base {
-      function __construct() {
-        var_dump('Child constructor');
-        parent::Base();
-      }
-    }
+class Base_php5 {
+  function __construct() {
+    var_dump('Base constructor');
   }
   
-  namespace mixed2 {
-    class Child extends php5::Base {
-      function Child() {
-        var_dump('Child constructor');
-        parent::__construct();
-      }
-    }
+  function Base_php5() {
+    var_dump('I should not be called');
   }
-  
-  echo "### PHP4 style\n";
-  $c4= new php4::Child();
+}
 
-  echo "### PHP5 style\n";
-  $c5= new php5::Child();
+class Child_php5 extends Base_php5 {
+  function __construct() {
+    var_dump('Child constructor');
+    parent::__construct();
+  }
   
-  echo "### Mixed style 1\n";
-  $cm= new mixed1::Child();
+  function Child_php5() {
+    var_dump('I should not be called');
+  }
+}
+
+class Child_mx1 extends Base_php4 {
+  function __construct() {
+    var_dump('Child constructor');
+    parent::Base_php4();
+  }
+}
 
-  echo "### Mixed style 2\n";
-  $cm= new mixed2::Child();
+class Child_mx2 extends Base_php5 {
+  function Child_mx2() {
+    var_dump('Child constructor');
+    parent::__construct();
+  }
+}
+
+echo "### PHP4 style\n";
+$c4= new Child_php4();
+
+echo "### PHP5 style\n";
+$c5= new Child_php5();
+
+echo "### Mixed style 1\n";
+$cm= new Child_mx1();
+
+echo "### Mixed style 2\n";
+$cm= new Child_mx2();
 ?>
 --EXPECT--
 ### PHP4 style
@@ -84,4 +76,4 @@ string(17) "Child constructor"
 string(16) "Base constructor"
 ### Mixed style 2
 string(17) "Child constructor"
-string(16) "Base constructor"
\ No newline at end of file
+string(16) "Base constructor"