Skip to content

Commit

Permalink
Merge branch 'PHP-8.2' into PHP-8.3
Browse files Browse the repository at this point in the history
* PHP-8.2:
  Fix phpGH-16181: phpdbg: exit in exception handler reports fatal error
  • Loading branch information
cmb69 committed Oct 3, 2024
2 parents bd724bd + f14e5cf commit 95c97c8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ PHP NEWS

- PHPDBG:
. Fixed bug GH-15901 (phpdbg: Assertion failure on i funcs). (cmb)
. Fixed bug GH-16181 (phpdbg: exit in exception handler reports fatal error).
(cmb)

- SimpleXML:
. Fixed bug GH-15837 (Segmentation fault in ext/simplexml/simplexml.c).
Expand Down
2 changes: 1 addition & 1 deletion sapi/phpdbg/phpdbg_prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ PHPDBG_COMMAND(run) /* {{{ */
}
} zend_end_try();

if (EG(exception)) {
if (EG(exception) && !zend_is_unwind_exit(EG(exception))) {
phpdbg_handle_exception();
}
}
Expand Down
26 changes: 26 additions & 0 deletions sapi/phpdbg/tests/gh16181.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--TEST--
GH-16181 (phpdbg: exit in exception handler reports fatal error)
--PHPDBG--
r
c
q
--FILE--
<?php
set_exception_handler(function() {
echo "exception caught\n";
die;
});

echo "throwing exception\n";
throw new \Exception("oh noes");
?>
--EXPECTF--
[Successful compilation of %s]
prompt> throwing exception
[Uncaught Exception in %s on line %d: oh noes]
>00008: throw new \Exception("oh noes");
00009: ?>
00010:
prompt> exception caught
[Script ended normally]
prompt>

0 comments on commit 95c97c8

Please sign in to comment.