Skip to content

Commit c592925

Browse files
committed
Merge branch 'PHP-5.6'
Conflicts: Zend/zend_compile.c
2 parents 3aea1dc + d7368c2 commit c592925

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

Zend/tests/bug67938.phpt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
Bug #67938: Segfault when extending interface method with variadic
3+
--FILE--
4+
<?php
5+
6+
interface TestInterface {
7+
public function foo();
8+
public function bar(array $bar);
9+
}
10+
11+
class Test implements TestInterface {
12+
public function foo(...$args) {
13+
echo __METHOD__, "\n";
14+
}
15+
public function bar(array $bar, ...$args) {
16+
echo __METHOD__, "\n";
17+
}
18+
}
19+
20+
$obj = new Test;
21+
$obj->foo();
22+
$obj->bar([]);
23+
24+
?>
25+
--EXPECT--
26+
Test::foo
27+
Test::bar

Zend/zend_compile.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
11211121
* go through all the parameters of the function and not just those present in the
11221122
* prototype. */
11231123
num_args = proto->common.num_args;
1124-
if ((fe->common.fn_flags & ZEND_ACC_VARIADIC)
1124+
if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
11251125
&& fe->common.num_args > proto->common.num_args) {
11261126
num_args = fe->common.num_args;
11271127
}

0 commit comments

Comments
 (0)