@@ -289,6 +289,20 @@ PHP 8.6 UPGRADE NOTES
289289 . Added TLS external PSK support for streams with new strem context options:
290290 psk_client_cb and psk_server_cb. This allows setting and receiving PSK.
291291
292+ - PCRE:
293+ . Added the PREG_THROW_ON_ERROR flag. When passed to a preg_*() function that
294+ accepts a $flags argument, any PCRE error reported by preg_last_error()
295+ throws a \PregException instead of emitting a warning or returning
296+ false/null. The exception's code and message are exactly what
297+ preg_last_error() and preg_last_error_msg() report for the same call: the
298+ flag changes how an error is delivered, not the error itself. This covers
299+ both compilation errors (such as a malformed pattern) and execution errors
300+ (such as an exhausted backtrack limit or malformed UTF-8 input under the /u
301+ modifier). preg_replace() and preg_filter() gained a $flags parameter to
302+ accept it. As on the non-flag path, by-reference outputs (the $matches and
303+ $count arguments) may already have been written when the \PregException is
304+ thrown, so a catch block should not assume they are left untouched.
305+
292306- Phar:
293307 . Overriding the getMTime() and getPathname() methods of SplFileInfo now
294308 influences the result of the phar buildFrom family of functions.
@@ -373,6 +387,10 @@ PHP 8.6 UPGRADE NOTES
373387 . Output of openssl_x509_parse() contains criticalExtensions listing all
374388 critical certificate extensions.
375389
390+ - PCRE:
391+ . preg_replace() and preg_filter() now accept an optional $flags argument
392+ (for PREG_THROW_ON_ERROR).
393+
376394- PDO_DBLIB:
377395 . When using persistent connections, there is now a liveness check in the
378396 constructor.
@@ -443,6 +461,9 @@ PHP 8.6 UPGRADE NOTES
443461 RFC: https://wiki.php.net/rfc/tls_session_resumption
444462 . Openssl\Psk
445463
464+ - PCRE:
465+ . PregException
466+
446467- Standard:
447468 . enum SortDirection
448469 RFC: https://wiki.php.net/rfc/sort_direction_enum
@@ -502,6 +523,9 @@ PHP 8.6 UPGRADE NOTES
502523 . CURL_SEEKFUNC_FAIL.
503524 . CURL_SEEKFUNC_CANTSEEK.
504525
526+ - PCRE:
527+ . PREG_THROW_ON_ERROR.
528+
505529- Sockets:
506530 . TCP_USER_TIMEOUT (Linux only).
507531 . AF_UNSPEC.
0 commit comments