Skip to content

Commit 4890bf1

Browse files
committed
Add error notification callbacks to UPGRADING.INTERNALS
1 parent 6744ead commit 4890bf1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

UPGRADING.INTERNALS

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ PHP 8.0 INTERNALS UPGRADE NOTES
2121
r. Cannot implement Traversable only
2222
s. zend_fcall_info no_separation flag removed
2323
t. Signature changes
24+
u. Error Notification callbacks to replace zend_error_cb overwrite use-cases
2425

2526
2. Build system changes
2627
a. Abstract
@@ -172,6 +173,22 @@ PHP 8.0 INTERNALS UPGRADE NOTES
172173
4. Argument int to size_t in Zend Engine 4.0:
173174
- zend_set_hash_symbol()
174175

176+
u. Instead of overwriting zend_error_cb extensions with debugging, monitoring
177+
use-cases catching Errors/Exceptions are strongly encouraged to use
178+
the new error notification API instead.
179+
180+
Error notification callbacks are guaranteed to be called regardless of
181+
the users error_reporting setting or userland error handler return values.
182+
183+
Register notification callbacks during MINIT of an extension:
184+
185+
void my_error_notify_cb(int type,
186+
const char *error_filename,
187+
uint32_t error_lineno,
188+
zend_string *message) {
189+
}
190+
zend_register_error_notify_callback(my_error_notify_cb);
191+
175192
========================
176193
2. Build system changes
177194
========================

0 commit comments

Comments
 (0)