Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test 035 fails after update to PHP 8.1 #91

Open
DaFox opened this issue Dec 15, 2021 · 1 comment
Open

Test 035 fails after update to PHP 8.1 #91

DaFox opened this issue Dec 15, 2021 · 1 comment

Comments

@DaFox
Copy link

DaFox commented Dec 15, 2021

After updating to PHP 8.1 test 035 using a local memcached with domain sockets fails.

Build

✎ apt-get -y install --no-install-recommends zlib1g-dev memcached
✎ memcached -du www-data
✎ memcached -du www-data -p 11212
✎ mkdir /var/run/memcached
✎ chown www-data /var/run/memcached
✎ memcached -du www-data -s /var/run/memcached/memcached.sock -a 722
✎ rm -rf memcache*
✎ curl -fsSLOJ https://pecl.php.net/get/memcache/stable
✎ phpize
✎ ./configure
✎ make
✎ make test

Result

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
memcache::connect() with unix domain socket [tests/035.phpt]
=====================================================================
⚡ make: *** [Makefile:133: test] Error 1

The problem is, that passing NULL as the second argument to memcache_connect() is deprecated in PHP 8.1 and triggers an error during the tests. I managed to run the tests using the following patch.

Workaround

sed -i 's/memcache_connect(\$domainsocket, null)/memcache_connect(\$domainsocket, 0)/' tests/035.phpt

However, i guess that the whole test-case should be removed or only be executed conditionally.

@TysonAndre
Copy link
Contributor

The problem is, that passing NULL as the second argument to memcache_connect() is deprecated in PHP 8.1 and triggers an error during the tests. I managed to run the tests using the following patch.

As you said, https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg deprecated it deliberately. Possible solutions: The arginfo can be changed to make it nullable, or the test can be changed - https://www.php.net/manual/en/memcache.addserver.php already documents that 0 should be passed, not null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants