Skip to content

Commit 3786b72

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix GH-17408: Assertion failure Zend/zend_exceptions.c
2 parents 0f8340d + 25543b4 commit 3786b72

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Zend/zend_exceptions.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /*
194194
zend_exception_set_previous(exception, EG(exception));
195195
EG(exception) = exception;
196196
if (previous) {
197-
ZEND_ASSERT(is_handle_exception_set() && "HANDLE_EXCEPTION not set?");
198197
return;
199198
}
200199
}

ext/zend_test/tests/gh17408.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
GH-17408 (Assertion failure Zend/zend_exceptions.c)
3+
--EXTENSIONS--
4+
zend_test
5+
--FILE--
6+
<?php
7+
function test() {
8+
$resource = zend_test_create_throwing_resource();
9+
zend_test_create_throwing_resource();
10+
}
11+
test();
12+
?>
13+
--EXPECTF--
14+
Fatal error: Uncaught Exception: Throwing resource destructor called in %s:%d
15+
Stack trace:
16+
#0 %s(%d): test()
17+
#1 {main}
18+
19+
Next Exception: Throwing resource destructor called in %s:%d
20+
Stack trace:
21+
#0 {main}
22+
thrown in %s on line %d

0 commit comments

Comments
 (0)