Skip to content

Commit 8160869

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix missing handling of CALLABLE_CONVERT in cleanup_unfinished_calls()
2 parents edb13b6 + 4393198 commit 8160869

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Zend/tests/gh14003.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
GH-14003: Missing handling of CALLABLE_CONVERT in cleanup_unfinished_calls()
3+
--FILE--
4+
<?php
5+
6+
function foo(string $key): string {
7+
throw new \Exception('Test');
8+
}
9+
10+
array_filter(
11+
array_combine(
12+
['a'],
13+
array_map(foo(...), ['a']),
14+
),
15+
);
16+
17+
?>
18+
--EXPECTF--
19+
Fatal error: Uncaught Exception: Test in %s:%d
20+
Stack trace:
21+
#0 [internal function]: foo('a')
22+
#1 %s(%d): array_map(Object(Closure), Array)
23+
#2 {main}
24+
thrown in %s on line %d

Zend/zend_execute.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4233,6 +4233,7 @@ ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_exe
42334233
case ZEND_DO_ICALL:
42344234
case ZEND_DO_UCALL:
42354235
case ZEND_DO_FCALL_BY_NAME:
4236+
case ZEND_CALLABLE_CONVERT:
42364237
level++;
42374238
break;
42384239
case ZEND_INIT_FCALL:
@@ -4288,6 +4289,7 @@ ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_exe
42884289
case ZEND_DO_ICALL:
42894290
case ZEND_DO_UCALL:
42904291
case ZEND_DO_FCALL_BY_NAME:
4292+
case ZEND_CALLABLE_CONVERT:
42914293
level++;
42924294
break;
42934295
case ZEND_INIT_FCALL:
@@ -4366,6 +4368,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
43664368
case ZEND_DO_ICALL:
43674369
case ZEND_DO_UCALL:
43684370
case ZEND_DO_FCALL_BY_NAME:
4371+
case ZEND_CALLABLE_CONVERT:
43694372
level++;
43704373
break;
43714374
case ZEND_INIT_FCALL:
@@ -4421,6 +4424,7 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
44214424
case ZEND_DO_ICALL:
44224425
case ZEND_DO_UCALL:
44234426
case ZEND_DO_FCALL_BY_NAME:
4427+
case ZEND_CALLABLE_CONVERT:
44244428
level++;
44254429
break;
44264430
case ZEND_INIT_FCALL:

0 commit comments

Comments
 (0)