logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: ZendEngine2 /tests bug29210.phpt bug32290.phpt: msg#00049

Subject: cvs: ZendEngine2 /tests bug29210.phpt bug32290.phpt
helly           Fri Dec 16 23:11:01 2005 EDT

  Modified files:              
    /ZendEngine2/tests  bug29210.phpt bug32290.phpt 
  Log:
  - MFB
  
http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug29210.phpt?r1=1.2&r2=1.3&diff_format=u
Index: ZendEngine2/tests/bug29210.phpt
diff -u ZendEngine2/tests/bug29210.phpt:1.2 ZendEngine2/tests/bug29210.phpt:1.3
--- ZendEngine2/tests/bug29210.phpt:1.2 Wed Apr 27 15:45:36 2005
+++ ZendEngine2/tests/bug29210.phpt     Fri Dec 16 23:11:00 2005
@@ -89,10 +89,14 @@
 $object = new foo();
 $object->test();
 ?>
---EXPECT--
+--EXPECTF--
 test_func1
 test_func2
+
+Strict Standards: Non-static method test_class::test_func3() canot be called 
statically, assuming $this from compatible context test_class in %sbug29210.php 
on line %d
 test_func3
+
+Strict Standards: Non-static method test_class::test_func4() canot be called 
statically, assuming $this from compatible context test_class in %sbug29210.php 
on line %d
 test_func4
 test_func1 isn't callable from outside
 test_func2 isn't callable from outside
@@ -100,5 +104,9 @@
 test_func4 isn't callable from outside
 test_func1 isn't callable from child
 test_func2
+
+Strict Standards: Non-static method test_class::test_func3() canot be called 
statically, assuming $this from compatible context foo in %sbug29210.php on 
line %d
 test_func3 isn't callable from child
+
+Strict Standards: Non-static method test_class::test_func4() canot be called 
statically, assuming $this from compatible context foo in %sbug29210.php on 
line %d
 test_func4
http://cvs.php.net/viewcvs.cgi/ZendEngine2/tests/bug32290.phpt?r1=1.3&r2=1.4&diff_format=u
Index: ZendEngine2/tests/bug32290.phpt
diff -u ZendEngine2/tests/bug32290.phpt:1.3 ZendEngine2/tests/bug32290.phpt:1.4
--- ZendEngine2/tests/bug32290.phpt:1.3 Thu Oct  6 19:02:20 2005
+++ ZendEngine2/tests/bug32290.phpt     Fri Dec 16 23:11:00 2005
@@ -3,17 +3,35 @@
 --FILE--
 <?php
 
-function my_error_handler($errno, $errstr, $errfile, $errline) {
-       var_dump($errstr);
-}
-
-set_error_handler('my_error_handler');
-
 class TestA
 {
        public function doSomething($i)
        {
-               echo __METHOD__ . "($this)\n";
+               echo __METHOD__ . "($i)\n";
+               return --$i;
+       }
+
+       public function doSomethingThis($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               return --$i;
+       }
+
+       public function doSomethingParent($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               return --$i;
+       }
+
+       public function doSomethingParentThis($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               return --$i;
+       }
+
+       public static function doSomethingStatic($i)
+       {
+               echo __METHOD__ . "($i)\n";
                return --$i;
        }
 }
@@ -22,22 +40,87 @@
 {
        public function doSomething($i)
        {
-               echo __METHOD__ . "($this)\n";
+               echo __METHOD__ . "($i)\n";
                $i++;
                if ($i >= 5) return 5;
-               return call_user_func_array(array("TestA","doSomething"), 
array($i));
+               return call_user_func_array(array("TestA", "doSomething"), 
array($i));
+       }
+
+       public function doSomethingThis($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               $i++;
+               if ($i >= 5) return 5;
+               return call_user_func_array(array($this, 
"TestA::doSomethingThis"), array($i));
+       }
+
+       public function doSomethingParent($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               $i++;
+               if ($i >= 5) return 5;
+               return call_user_func_array(array("parent", 
"doSomethingParent"), array($i));
+       }
+
+       public function doSomethingParentThis($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               $i++;
+               if ($i >= 5) return 5;
+               return call_user_func_array(array($this, 
"parent::doSomethingParentThis"), array($i));
+       }
+
+       public static function doSomethingStatic($i)
+       {
+               echo __METHOD__ . "($i)\n";
+               $i++;
+               if ($i >= 5) return 5;
+               return call_user_func_array(array("TestA", 
"doSomethingStatic"), array($i));
        }
 }
 
 $x = new TestB();
+echo "===A===\n";
 var_dump($x->doSomething(1));
+echo "\n===B===\n";
+var_dump($x->doSomethingThis(1));
+echo "\n===C===\n";
+var_dump($x->doSomethingParent(1));
+echo "\n===D===\n";
+var_dump($x->doSomethingParentThis(1));
+echo "\n===E===\n";
+var_dump($x->doSomethingStatic(1));
 
 ?>
 ===DONE===
+<?php exit(0); ?>
 --EXPECTF--
-string(54) "Object of class TestB could not be converted to string"
-TestB::doSomething()
-string(54) "Object of class TestB could not be converted to string"
-TestA::doSomething()
+===A===
+TestB::doSomething(1)
+
+Strict Standards: Non-static method TestA::doSomething() canot be called 
statically, assuming $this from compatible context TestB in %sbug32290.php on 
line %d
+TestA::doSomething(2)
+int(1)
+
+===B===
+TestB::doSomethingThis(1)
+TestA::doSomethingThis(2)
+int(1)
+
+===C===
+TestB::doSomethingParent(1)
+
+Strict Standards: Non-static method TestA::doSomethingParent() canot be called 
statically, assuming $this from compatible context TestB in %sbug32290.php on 
line %d
+TestA::doSomethingParent(2)
+int(1)
+
+===D===
+TestB::doSomethingParentThis(1)
+TestA::doSomethingParentThis(2)
+int(1)
+
+===E===
+TestB::doSomethingStatic(1)
+TestA::doSomethingStatic(2)
 int(1)
 ===DONE===

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>