Skip to content

Commit 9e25c4b

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fixed bug #81626
2 parents 1c25c55 + d26965b commit 9e25c4b

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ PHP NEWS
77
from a trait). (Nikita)
88
. Fixed bug #81591 (Fatal Error not properly logged in particular cases).
99
(Nikita)
10+
. Fixed bug #81626 (Error on use static:: in __сallStatic() wrapped to
11+
Closure::fromCallable()). (Nikita)
1012

1113
- FPM:
1214
. Fixed bug #81513 (Future possibility for heap overflow in FPM zlog).

Zend/tests/bug81626.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Bug #81626: Error on use static:: in __сallStatic() wrapped to Closure::fromCallable()
3+
--FILE--
4+
<?php
5+
class TestClass {
6+
public static bool $wasCalled = false;
7+
public static function __callStatic(string $name, array $args): string
8+
{
9+
static::$wasCalled = true;
10+
return 'ok';
11+
}
12+
}
13+
$closure = Closure::fromCallable([TestClass::class, 'foo']);
14+
var_dump($closure());
15+
?>
16+
--EXPECT--
17+
string(2) "ok"

Zend/zend_closures.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ {
288288
}
289289

290290
fcc.object = fci.object = Z_OBJ_P(ZEND_THIS);
291+
fcc.called_scope = zend_get_called_scope(EG(current_execute_data));
291292

292293
zend_call_function(&fci, &fcc);
293294

0 commit comments

Comments
 (0)