1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00

Merge branch 'PHP-8.2'

* PHP-8.2:
  Don't check "fake" closures (fix assertion)
This commit is contained in:
Dmitry Stogov
2022-11-07 12:21:03 +03:00
3 changed files with 20 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
--TEST--
First class callables and &__call()
--FILE--
<?php
class Foo {
public function &__call($method, $args) {
return $method;
}
}
$foo = new Foo;
$bar = $foo->bar(...);
echo $bar(),"\n";
?>
--EXPECT--
bar
+1 -1
View File
@@ -4165,7 +4165,7 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL,OBSERVER))
}
#if ZEND_DEBUG
if (!EG(exception) && call->func) {
if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
if (should_throw) {
zend_internal_call_arginfo_violation(call->func);
}
+3 -3
View File
@@ -1845,7 +1845,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
}
#if ZEND_DEBUG
if (!EG(exception) && call->func) {
if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
if (should_throw) {
zend_internal_call_arginfo_violation(call->func);
}
@@ -1954,7 +1954,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
}
#if ZEND_DEBUG
if (!EG(exception) && call->func) {
if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
if (should_throw) {
zend_internal_call_arginfo_violation(call->func);
}
@@ -2064,7 +2064,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_OBS
}
#if ZEND_DEBUG
if (!EG(exception) && call->func) {
if (!EG(exception) && call->func && !(call->func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
if (should_throw) {
zend_internal_call_arginfo_violation(call->func);
}