View Issue Details

IDProjectCategoryView StatusLast Update
0002274XdebugStep Debuggingpublic2025-01-19 09:13
Reportertefxacn Assigned Toderick  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionnot fixable 
Product Version3.3.2 
Summary0002274: xdebug_start_function_monitor doesn't work with "exit"
Description

xdebug_start_function_monitor doesn't track calls to "exit(1)"

Steps To Reproduce
function my_shutdown() {
    xdebug_notify(xdebug_get_monitored_functions());
    xdebug_stop_function_monitor();
}

xdebug_start_function_monitor(['exit']);
register_shutdown_function('my_shutdown');

function bar() {
    echo 'hello';
    exit(1);
}
bar();

It will report an empty array, but I'd expect it to be non-empty since "exit(1)" was called.

TagsNo tags attached.
Operating System
PHP Version8.2.0-8.2.9

Activities

derick

2024-06-17 23:02

administrator   ~0006974

exit isn't a function in PHP, but a language construct.

There are some plans of changing this: https://wiki.php.net/rfc/exit-as-function

derick

2024-07-10 16:02

administrator   ~0006987

This can currently not be fixed, as exit isn't a function in PHP, but a language construct.

When (or rather, if) exit becomes a function as per a suggestion in https://wiki.php.net/rfc/exit-as-function, this will magically start working.

tefxacn

2025-01-19 09:13

reporter   ~0007160

Since PHP 8.4 https://www.php.net/manual/en/function.exit.php it should work:

exit() is now a proper function, therefore it follows the usual type juggling semantics is affected by the strict_types declare, can be called with named arguments, and be a variable functions.

Issue History

Date Modified Username Field Change
2024-06-17 22:44 tefxacn New Issue
2024-06-17 23:02 derick Note Added: 0006974
2024-07-10 16:02 derick Assigned To => derick
2024-07-10 16:02 derick Status new => resolved
2024-07-10 16:02 derick Resolution open => not fixable
2024-07-10 16:02 derick Note Added: 0006987
2025-01-19 09:13 tefxacn Note Added: 0007160