From: Johannes Schlüter Date: Sat, 1 Mar 2008 13:53:10 +0000 (+0000) Subject: - Allow implementation of abstract methods with optional parameters (Christian X-Git-Tag: RELEASE_2_0_0a1~283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3c4c2496cc369005ca92365f1e40720baf17029;p=php - Allow implementation of abstract methods with optional parameters (Christian Schneider) --- diff --git a/Zend/tests/022.phpt b/Zend/tests/022.phpt new file mode 100644 index 0000000000..1226e2719f --- /dev/null +++ b/Zend/tests/022.phpt @@ -0,0 +1,24 @@ +--TEST-- +Implementating abstracting methods and optional parameters +--FILE-- +someMethod("foo"); +$a->someMethod(); +--EXPECT-- +foo +default diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 28876a73b8..c58bfa4315 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2482,7 +2482,7 @@ static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_fu } /* check number of arguments */ - if (proto->common.required_num_args != fe->common.required_num_args + if (proto->common.required_num_args < fe->common.required_num_args || proto->common.num_args > fe->common.num_args) { return 0; }