Expected Test Failure Report for Zend/tests/bug48770_2.phpt ('Bug #48770 (call_user_func_array() fails to call parent from inheriting class)')
Script
1:
<?php 2: 3: class A { 4: public function func($str) { 5: var_dump(__METHOD__ .': '. $str); 6: } 7: private function func2($str) { 8: var_dump(__METHOD__ .': '. $str); 9: } 10: protected function func3($str) { 11: var_dump(__METHOD__ .': '. $str); 12: } 13: private function func22($str) { 14: var_dump(__METHOD__ .': '. $str); 15: } 16: } 17: 18: class B extends A { 19: public function func($str) { 20: call_user_func_array(array($this, 'parent::func2'), array($str)); 21: call_user_func_array(array($this, 'parent::func3'), array($str)); 22: call_user_func_array(array($this, 'parent::func22'), array($str)); 23: call_user_func_array(array($this, 'parent::inexistent'), array($str)); 24: } 25: private function func2($str) { 26: var_dump(__METHOD__ .': '. $str); 27: } 28: protected function func3($str) { 29: var_dump(__METHOD__ .': '. $str); 30: } 31: } 32: 33: class C extends B { 34: public function func($str) { 35: parent::func($str); 36: } 37: } 38: 39: $c = new C; 40: $c->func('This should work!'); 41: 42: ?> 43:
Expected
%unicode|string%(27) "A::func2: This should work!"
%unicode|string%(27) "A::func3: This should work!"
Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22() in %s on line %d
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'A' does not have a method 'inexistent' in %s on line %d
Output
string(27) "B::func2: This should work!"
string(27) "B::func3: This should work!"
Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method B::func22() in /var/php_gcov/PHP_HEAD/Zend/tests/bug48770_2.php on line 22
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent' in /var/php_gcov/PHP_HEAD/Zend/tests/bug48770_2.php on line 23
Diff
001+ string(27) "B::func2: This should work!"
002+ string(27) "B::func3: This should work!"
003+
004+ Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method B::func22() in /var/php_gcov/PHP_HEAD/Zend/tests/bug48770_2.php on line 22
001- %unicode|string%(27) "A::func2: This should work!"
002- %unicode|string%(27) "A::func3: This should work!"
004- Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22() in %s on line %d
006+ Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent' in /var/php_gcov/PHP_HEAD/Zend/tests/bug48770_2.php on line 23
005-
006- Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'A' does not have a method 'inexistent' in %s on line %d
Generated at Fri, 17 May 2013 23:23:52 +0000 (4 days ago)
|