From e3c4c2496cc369005ca92365f1e40720baf17029 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johannes=20Schl=C3=BCter?= Date: Sat, 1 Mar 2008 13:53:10 +0000 Subject: [PATCH] - Allow implementation of abstract methods with optional parameters (Christian Schneider) --- Zend/tests/022.phpt | 24 ++++++++++++++++++++++++ Zend/zend_compile.c | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/022.phpt 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; } -- 2.40.0