Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sapi/phpdbg/phpdbg_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ PHPDBG_API bool phpdbg_check_caught_ex(zend_execute_data *execute_data, zend_obj
zend_class_entry *ce;

if (!(ce = CACHED_PTR(cur->extended_value & ~ZEND_LAST_CATCH))) {
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(cur, cur->op1)), Z_STR_P(RT_CONSTANT(cur, cur->op1) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD);
ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(cur, cur->op1)), Z_STR_P(RT_CONSTANT(cur, cur->op1) + 1), ZEND_FETCH_CLASS_NO_AUTOLOAD | ZEND_FETCH_CLASS_SILENT);
CACHE_PTR(cur->extended_value & ~ZEND_LAST_CATCH, ce);
}

Expand Down
20 changes: 20 additions & 0 deletions sapi/phpdbg/tests/exceptions_004.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
GH-22168 (Exception caught by a later catch is not misreported as uncaught when an earlier catch references a non-existent class)
--PHPDBG--
r
q
--EXPECTF--
[Successful compilation of %s]
prompt> Caught it. 'handled' it
[Script ended normally]
prompt>
--FILE--
<?php declare(strict_types=1);

try {
throw new RuntimeException();
} catch (LibrarySpecificException) {
// A library specific exception. Not autoloaded since it did not happen.
} catch (RuntimeException) {
echo "Caught it. 'handled' it\n";
}
Loading