Skip to content

zlib: fix test skipif sections#22099

Merged
ndossche merged 1 commit into
php:PHP-8.4from
ndossche:zlib-test-fix
May 24, 2026
Merged

zlib: fix test skipif sections#22099
ndossche merged 1 commit into
php:PHP-8.4from
ndossche:zlib-test-fix

Conversation

@ndossche
Copy link
Copy Markdown
Member

Depending on the specific PHP configuration, the regex matching for the version number in get_zlib_version() can fail.
On master, this results in deprecation warnings and subsequent test borks:

Deprecated: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in /work/php-src/ext/zlib/tests/gzgetc_basic.skip.php on line 3 [/work/php-src/ext/zlib/tests/gzgetc_basic.phpt]
Deprecated: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in /work/php-src/ext/zlib/tests/gzgetc_basic_1.skip.php on line 4

Since ZLIB_VERSION is a constant containing the version as a string, remove all this nonsense and just use the constant directly.

Found whilst working on my analyzer.

Depending on the specific PHP configuration, the regex matching for the
version number in get_zlib_version() can fail.
On master, this results in deprecation warnings and subsequent test
borks:
```
Deprecated: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in /work/php-src/ext/zlib/tests/gzgetc_basic.skip.php on line 3 [/work/php-src/ext/zlib/tests/gzgetc_basic.phpt]
Deprecated: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in /work/php-src/ext/zlib/tests/gzgetc_basic_1.skip.php on line 4
```

Since ZLIB_VERSION is a constant containing the version as a string,
remove all this nonsense and just use the constant directly.
@ndossche ndossche merged commit 7727193 into php:PHP-8.4 May 24, 2026
19 checks passed
ndossche added a commit that referenced this pull request May 24, 2026
* PHP-8.5:
  zlib: fix test skipif sections (#22099)
pull Bot pushed a commit to ppker/php-src that referenced this pull request May 24, 2026
* PHP-8.4:
  zlib: fix test skipif sections (php#22099)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants