Public bug reported:

By default jammy 22.04 comes with PHP8.1. The memcached extension that
comes by default is 3.1.5.

However, 3.1.* branch is compatible just with PHP7. In order to have a
version fully compatible with PHP8, it looks like branch php-memcached
3.2 is needed according to this release changelog:
https://github.com/php-memcached-dev/php-memcached/releases/tag/v3.2.0

Note that this piece of code fails with Jammy (apt-get install memcached
php-cli php-memcached):

```
<?php

$memcached = new Memcached();
$memcached->addServer('localhost', 11211);

$memcached->set('key', 'value');
$value = $memcached->get('key', null, Memcached::GET_EXTENDED);
$memcached->cas($value['cas'], 'key', 'value2', 1111);
echo $memcached->get('key') . PHP_EOL;
```

calling to Memcached::cas() with an expiration value (fourth argument)
throws this error:

PHP Fatal error:  Uncaught TypeError: Memcached::cas(): Argument #4
($expiration) must be of type int, int given

Note that this code also works well when being run with Ondřej Surý PPA:
https://launchpad.net/~ondrej/+archive/ubuntu/php/+packages?field.name_filter=php-
memcached&field.status_filter=published&field.series_filter=

which contains php-memcached 3.2.0 (php8 compliant) rather than (3.1.5).

Above code does not fail either when run in focal 20.04 nor in noble
24.04.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: php8.1-memcached 3.1.5+2.2.0-14.1
ProcVersionSignature: Ubuntu 5.14.0-1005.5-oem 5.14.9
Uname: Linux 5.14.0-1005-oem x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudID: lxd
CloudName: lxd
CloudPlatform: lxd
CloudSubPlatform: LXD socket API v. 1.0 (/dev/lxd/sock)
Date: Thu Jul 18 14:19:25 2024
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=C.UTF-8
SourcePackage: php-memcached
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: php-memcached (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug jammy php php-memcached uec-images

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2073517

Title:
  default jammy php8.1-memcached non compliant with php8.1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/php-memcached/+bug/2073517/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to