Skip to content

Commit f5d8d84

Browse files
committed
fix: readd call to original error handler in OAPI
1 parent 7e56ae9 commit f5d8d84

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

agent/php_error.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,6 @@ void nr_php_error_cb(int type,
563563
const char* format,
564564
va_list args) {
565565
#endif /* PHP >= 8.1 */
566-
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
567-
&& !defined OVERWRITE_ZEND_EXECUTE_DATA /* PHP 8.0+ and OAPI */
568-
(void)error_filename;
569-
(void)error_lineno;
570-
#endif
571566
TSRMLS_FETCH();
572567
char* stack_json = NULL;
573568
const char* errclass = NULL;
@@ -622,20 +617,18 @@ void nr_php_error_cb(int type,
622617
nr_free(msg);
623618
nr_free(stack_json);
624619
}
625-
/*
626-
* Call through to the actual error handler for PHP 7.4 and below.
627-
* For PHP 8+ we have registered our error handler with the Observer
628-
* API so there is no need to callback to the original.
629-
*/
630620
/*
631621
* Call through to the actual error handler.
632622
*/
633-
#if ZEND_MODULE_API_NO < ZEND_8_0_X_API_NO
634623
if (0 != NR_PHP_PROCESS_GLOBALS(orig_error_cb)) {
624+
#if ZEND_MODULE_API_NO < ZEND_8_0_X_API_NO
635625
NR_PHP_PROCESS_GLOBALS(orig_error_cb)
636626
(type, error_filename, error_lineno, format, args);
637-
}
627+
#else
628+
NR_PHP_PROCESS_GLOBALS(orig_error_cb)
629+
(type, error_filename, error_lineno, message);
638630
#endif /* PHP < 8.0 */
631+
}
639632
}
640633

641634
nr_status_t nr_php_error_record_exception(nrtxn_t* txn,

0 commit comments

Comments
 (0)