summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-08-30 20:45:10 +0200
committerNikita Popov <nikic@php.net>2014-08-30 20:45:10 +0200
commitc59292570cd6dc8ba83de305526becd70e3db992 (patch)
tree89fb4c8c5e967a6d2f27ad5766af41187309056d
parent3aea1dca06737acff3d5ec460aa1e68b770bf1b5 (diff)
parentd7368c2531ad1268d43c894b8422a61b70c70e5a (diff)
downloadphp-git-c59292570cd6dc8ba83de305526becd70e3db992.tar.gz
Merge branch 'PHP-5.6'
Conflicts: Zend/zend_compile.c
-rw-r--r--Zend/tests/bug67938.phpt27
-rw-r--r--Zend/zend_compile.c2
2 files changed, 28 insertions, 1 deletions
diff --git a/Zend/tests/bug67938.phpt b/Zend/tests/bug67938.phpt
new file mode 100644
index 0000000000..6597c4895f
--- /dev/null
+++ b/Zend/tests/bug67938.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #67938: Segfault when extending interface method with variadic
+--FILE--
+<?php
+
+interface TestInterface {
+ public function foo();
+ public function bar(array $bar);
+}
+
+class Test implements TestInterface {
+ public function foo(...$args) {
+ echo __METHOD__, "\n";
+ }
+ public function bar(array $bar, ...$args) {
+ echo __METHOD__, "\n";
+ }
+}
+
+$obj = new Test;
+$obj->foo();
+$obj->bar([]);
+
+?>
+--EXPECT--
+Test::foo
+Test::bar
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 5d1fe7fbd8..4fbdff3059 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1121,7 +1121,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
* go through all the parameters of the function and not just those present in the
* prototype. */
num_args = proto->common.num_args;
- if ((fe->common.fn_flags & ZEND_ACC_VARIADIC)
+ if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
&& fe->common.num_args > proto->common.num_args) {
num_args = fe->common.num_args;
}