Skip to content

Commit 6b6e3c7

Browse files
committed
fix a test that is about to exist
1 parent 608a22e commit 6b6e3c7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Zend/tests/partial_function/closures.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ print $ref->getReturnType() . PHP_EOL;
2626
int
2727
z
2828
int
29+
--XFAIL--
30+
This can't pass

Zend/zend_partial.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ static zend_always_inline void zend_partial_prototype_u(zend_partial *partial, z
128128

129129
partial->prototype.common.fn_flags |= ZEND_ACC_ABSTRACT;
130130

131-
if (partial->prototype.common.fn_flags & ZEND_ACC_VARIADIC) {
131+
if (partial->prototype.common.fn_flags & ZEND_ACC_VARIADIC &&
132+
partial->prototype.common.num_args > 0) {
132133
partial->prototype.common.num_args--;
133134
}
134135
}
@@ -180,7 +181,8 @@ static zend_always_inline void zend_partial_prototype_i(zend_partial *partial, z
180181

181182
partial->prototype.common.fn_flags |= ZEND_ACC_ABSTRACT;
182183

183-
if (partial->prototype.common.fn_flags & ZEND_ACC_VARIADIC) {
184+
if (partial->prototype.common.fn_flags & ZEND_ACC_VARIADIC &&
185+
partial->prototype.common.num_args > 0) {
184186
partial->prototype.common.num_args--;
185187
}
186188
}

0 commit comments

Comments
 (0)