[php-src] PR #12708: Convert more zlib warnings to exceptions
| From: | bor0 | Date: | Fri, 17 Nov 2023 18:46:27 +0000 |
| Subject: | [php-src] PR #12708: Convert more zlib warnings to exceptions | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-24226@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12708
Author: bor0
This PR further extends the functionality of a previous PR #4985.
Ran into this while working on a [particular WordPress
functionality](https://github.com/Automattic/jetpack/pull/34186) - our servers reported tons of
warnings. Currently, the only way to avoid warnings is to call
@gzinflate, but
silencing errors is discouraged so we also have to phpcs:ignore it. If
gzinflate threw an exception instead, it would be much easier for developers to handle
this.
Applied same reasoning to all the zlib functions.
I also found out that the json extension also does not use any notices:
```
bor0:~/dev/php-src/ext/json$ grep -R php_error_docref *
bor0:~/dev/php-src/ext/json$
```
⚠️This is a breaking change and may cause code flow interruptions unless handled with
exceptions⚠️