Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ dist: trusty

language: php
php:
- master
- 7.2
- 7.1
- 7.0

matrix:
fast_finish: true
allow_failures:
- php: master

env:
- LIBMEMCACHED_VERSION=1.0.18 # Debian Jessie / Ubuntu Xenial
Expand Down
4 changes: 2 additions & 2 deletions php_memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ static PHP_METHOD(Memcached, __construct)
le.type = php_memc_list_entry();
le.ptr = intern->memc;

GC_REFCOUNT(&le) = 1;
GC_SET_REFCOUNT(&le, 1);

/* plist_key is not a persistent allocated key, thus we use str_update here */
if (zend_hash_str_update_mem(&EG(persistent_list), ZSTR_VAL(plist_key), ZSTR_LEN(plist_key), &le, sizeof(le)) == NULL) {
Expand Down Expand Up @@ -3831,7 +3831,7 @@ PHP_METHOD(MemcachedServer, on)

Z_TRY_ADDREF(fci.function_name);
if (fci.object) {
GC_REFCOUNT(fci.object)++;
GC_ADDREF(fci.object);
}
}
RETURN_BOOL(rc);
Expand Down
7 changes: 7 additions & 0 deletions php_memcached_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ typedef unsigned long int uint32_t;
# endif
#endif

/* Backwards compatibility for GC API change in PHP 7.3 */
#if PHP_VERSION_ID < 70300
# define GC_ADDREF(p) ++GC_REFCOUNT(p)
# define GC_DELREF(p) --GC_REFCOUNT(p)
# define GC_SET_REFCOUNT(p, rc) GC_REFCOUNT(p) = rc
#endif

/****************************************
Structures and definitions
****************************************/
Expand Down
2 changes: 1 addition & 1 deletion php_memcached_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ PS_OPEN_FUNC(memcached)
le.type = s_memc_sess_list_entry();
le.ptr = memc;

GC_REFCOUNT(&le) = 1;
GC_SET_REFCOUNT(&le, 1);

/* plist_key is not a persistent allocated key, thus we use str_update here */
if (zend_hash_str_update_mem(&EG(persistent_list), plist_key, plist_key_len, &le, sizeof(le)) == NULL) {
Expand Down