diff --git a/Zend/tests/argument_restriction_001.phpt b/Zend/tests/argument_restriction_001.phpt index e62ad300c97b1..2db819a45c203 100644 --- a/Zend/tests/argument_restriction_001.phpt +++ b/Zend/tests/argument_restriction_001.phpt @@ -8,7 +8,7 @@ Class Base { } class Sub extends Base { - public function &test() { + public function &test(array $bar) { } } ?> diff --git a/Zend/tests/argument_restriction_002.phpt b/Zend/tests/argument_restriction_002.phpt index c6a472e0f5669..0af4298a83f97 100644 --- a/Zend/tests/argument_restriction_002.phpt +++ b/Zend/tests/argument_restriction_002.phpt @@ -8,7 +8,7 @@ Abstract Class Base { } class Sub extends Base { - public function test($foo, array &$bar) { + public function test($foo, array $bar) { } } ?> diff --git a/Zend/tests/argument_restriction_003.phpt b/Zend/tests/argument_restriction_003.phpt index 393581fcfccfb..691f432f8ca70 100644 --- a/Zend/tests/argument_restriction_003.phpt +++ b/Zend/tests/argument_restriction_003.phpt @@ -11,7 +11,7 @@ Abstract Class Base { } class Sub extends Base { - public function test() { + public function test(Bar $foo) { } } ?> diff --git a/Zend/tests/argument_restriction_005.phpt b/Zend/tests/argument_restriction_005.phpt index 2826fe6a81f6d..150de0a1c6c56 100644 --- a/Zend/tests/argument_restriction_005.phpt +++ b/Zend/tests/argument_restriction_005.phpt @@ -3,7 +3,7 @@ Bug #55719 (Argument restriction should come with a more specific error message) --FILE-- diff --git a/Zend/tests/bug47981.phpt b/Zend/tests/bug47981.phpt index c0fd69abf9481..e814d8e451a58 100644 --- a/Zend/tests/bug47981.phpt +++ b/Zend/tests/bug47981.phpt @@ -11,7 +11,7 @@ set_error_handler("errh"); interface a{} class b implements a { function f($a=1) {}} -class c extends b {function f() {}} +class c extends b {function f($a) {}} ?> --EXPECTF-- string(60) "Declaration of c::f() should be compatible with b::f($a = 1)" diff --git a/Zend/tests/bug51421.phpt b/Zend/tests/bug51421.phpt index bc1758c300802..a22de7dcde588 100644 --- a/Zend/tests/bug51421.phpt +++ b/Zend/tests/bug51421.phpt @@ -10,7 +10,7 @@ abstract class TestInterface { } class Test extends TestInterface { - public function __construct() {} + public function __construct(OtherClass $var) {} } ?> diff --git a/Zend/tests/bug64988.phpt b/Zend/tests/bug64988.phpt index 34fd482f384e4..e0e9606b25259 100644 --- a/Zend/tests/bug64988.phpt +++ b/Zend/tests/bug64988.phpt @@ -17,7 +17,7 @@ class Noisy1 extends Base1 { } } class Smooth1 extends Noisy1 { - public function insert(array $data) { + public function insert(array $data, $option1) { return parent::insert($data, count($data)); } } diff --git a/Zend/tests/traits/bug60153.phpt b/Zend/tests/traits/bug60153.phpt index 979eced1fb274..4470c0653036a 100644 --- a/Zend/tests/traits/bug60153.phpt +++ b/Zend/tests/traits/bug60153.phpt @@ -8,7 +8,7 @@ interface IFoo { } trait TFoo { - public function oneArgument() {} + public function oneArgument($a, $b) {} } class C implements IFoo { @@ -16,4 +16,4 @@ class C implements IFoo { } --EXPECTF-- -Fatal error: Declaration of TFoo::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d +Fatal error: Declaration of TFoo::oneArgument($a, $b) must be compatible with IFoo::oneArgument($a) in %s on line %d diff --git a/Zend/tests/traits/bug60217b.phpt b/Zend/tests/traits/bug60217b.phpt index eb852a4fb43c8..23c2a6cd2af1f 100644 --- a/Zend/tests/traits/bug60217b.phpt +++ b/Zend/tests/traits/bug60217b.phpt @@ -8,7 +8,7 @@ trait TBroken1 { } trait TBroken2 { - public abstract function foo($a, $b = 0); + public abstract function foo($a, $b); } class CBroken { @@ -23,4 +23,4 @@ $o = new CBroken; $o->foo(1); --EXPECTF-- -Fatal error: Declaration of TBroken2::foo($a, $b = 0) must be compatible with TBroken1::foo($a) in %s on line %d +Fatal error: Declaration of TBroken2::foo($a, $b) must be compatible with TBroken1::foo($a) in %s on line %d diff --git a/Zend/tests/traits/bug60217c.phpt b/Zend/tests/traits/bug60217c.phpt index baa4314a61ade..7bba3f5045a7e 100644 --- a/Zend/tests/traits/bug60217c.phpt +++ b/Zend/tests/traits/bug60217c.phpt @@ -4,7 +4,7 @@ Bug #60217 (Requiring the same method from different traits and abstract methods foo(1); --EXPECTF-- -Fatal error: Declaration of TBroken2::foo($a) must be compatible with TBroken1::foo($a, $b = 0) in %s on line %d +Fatal error: Declaration of TBroken2::foo($a) must be compatible with TBroken1::foo($a, $b) in %s on line %d diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f250b2be20879..f8f80e3391a30 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3115,7 +3115,7 @@ static void do_inherit_method(zend_function *function) /* {{{ */ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */ { - zend_uint i; + zend_uint i, num_args; /* If it's a user function then arg_info == NULL means we don't have any parameters but * we still need to do the arg number checks. We are only willing to ignore this for internal @@ -3140,8 +3140,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c } /* check number of arguments */ - if (proto->common.required_num_args < fe->common.required_num_args - || proto->common.num_args > fe->common.num_args) { + if (proto->common.required_num_args < fe->common.required_num_args) { return 0; } @@ -3157,7 +3156,9 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c return 0; } - for (i=0; i < proto->common.num_args; i++) { + num_args = MIN(proto->common.num_args, fe->common.num_args); + + for (i = 0; i < num_args; i++) { if (ZEND_LOG_XOR(fe->common.arg_info[i].class_name, proto->common.arg_info[i].class_name)) { /* Only one has a type hint and the other one doesn't */ return 0; diff --git a/ext/standard/tests/filters/php_user_filter_01.phpt b/ext/standard/tests/filters/php_user_filter_01.phpt index e4a9c6853cdfb..db806329a2bdf 100644 --- a/ext/standard/tests/filters/php_user_filter_01.phpt +++ b/ext/standard/tests/filters/php_user_filter_01.phpt @@ -13,5 +13,6 @@ class bar extends php_user_filter { function onClose() {} } ?> +===DONE=== --EXPECTF-- -Strict Standards: Declaration of bar::filter() should be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d +===DONE=== diff --git a/tests/classes/ctor_in_interface_02.phpt b/tests/classes/ctor_in_interface_02.phpt index 08e6f36e0e680..e2a6d87295d8d 100644 --- a/tests/classes/ctor_in_interface_02.phpt +++ b/tests/classes/ctor_in_interface_02.phpt @@ -4,7 +4,7 @@ ZE2 A class constructor must keep the signature of all interfaces ===DONE=== --EXPECTF-- - -Strict Standards: Declaration of B::f() should be compatible with A::f($x) in %sinheritance_003.php on line %d ===DONE=== diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt index 333c29d128903..5136681389b41 100644 --- a/tests/classes/method_override_optional_arg_001.phpt +++ b/tests/classes/method_override_optional_arg_001.phpt @@ -28,6 +28,5 @@ $b->foo(1); ?> --EXPECTF-- -Strict Standards: Declaration of C::foo() should be compatible with A::foo($arg1 = 1) in %s on line %d int(1) int(3) diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt index 669a8ca836691..16973a9230139 100644 --- a/tests/classes/method_override_optional_arg_002.phpt +++ b/tests/classes/method_override_optional_arg_002.phpt @@ -18,5 +18,4 @@ $b->foo(); ?> --EXPECTF-- -Strict Standards: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d foo