Skip to content

zlib: fix test skipif sections#22099

Open
ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:zlib-test-fix
Open

zlib: fix test skipif sections#22099
ndossche wants to merge 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.
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.

1 participant