Skip to content

Commit

Permalink
trivial/minimal fix for PHP 8.2 (websupport-sk#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
remicollet authored Oct 25, 2022
1 parent 50c351a commit 26c0f51
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/memcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,15 @@ PHP_MINIT_FUNCTION(memcache)

INIT_CLASS_ENTRY(ce, "MemcachePool", php_memcache_pool_class_functions);
memcache_pool_ce = zend_register_internal_class(&ce);
#if PHP_VERSION_ID >= 80200
memcache_pool_ce->ce_flags |= ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES;
#endif

INIT_CLASS_ENTRY(ce, "Memcache", php_memcache_class_functions);
memcache_ce = zend_register_internal_class_ex(&ce, memcache_pool_ce);
#if PHP_VERSION_ID >= 80200
memcache_ce->ce_flags |= ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES;
#endif

le_memcache_pool = zend_register_list_destructors_ex(_mmc_pool_list_dtor, NULL, "memcache connection", module_number);
le_memcache_server = zend_register_list_destructors_ex(NULL, _mmc_server_list_dtor, "persistent memcache connection", module_number);
Expand Down
2 changes: 1 addition & 1 deletion tests/029.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (is_array($result))
sort($result);
var_dump($result);

$result = ini_set('memcache.allow_failover', "abc");
$result = @ini_set('memcache.allow_failover', "abc");
var_dump($result);

?>
Expand Down
4 changes: 3 additions & 1 deletion tests/045.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Nested get's in __wakeup()
include 'connect.inc';

class testclass {
public $result = null;

function __wakeup() {
global $memcache;
$this->result = $memcache->get('_test_key3');
Expand Down Expand Up @@ -48,4 +50,4 @@ array(2) {
[0]=>
int(123)
}
}
}

0 comments on commit 26c0f51

Please sign in to comment.