Skip to content

Commit 08f9b50

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Don't check "fake" closures (fix assertion)
2 parents 5e23cf9 + 05b63b1 commit 08f9b50

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
First class callables and &__call()
3+
--FILE--
4+
<?php
5+
class Foo {
6+
public function &__call($method, $args) {
7+
return $method;
8+
}
9+
}
10+
11+
$foo = new Foo;
12+
$bar = $foo->bar(...);
13+
echo $bar(),"\n";
14+
?>
15+
--EXPECT--
16+
bar

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4165,7 +4165,7 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER))
41654165
}
41664166

41674167
#if ZEND_DEBUG
4168-
if (!EG(exception) && call->func) {
4168+
if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
41694169
if (should_throw) {
41704170
zend_internal_call_arginfo_violation(call->func);
41714171
}

Zend/zend_vm_execute.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)