You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since upgrading from 3.1.4 to 3.1.5 we're getting warning
PHP Warning: Declaration of MemcachedWrapper::addServers(array $a_servers): bool should be compatible with Memcached::addServers($servers) in test.php on line 47
<?php/** * Class MemcachedWrapper * @package App\System\Memcached */class MemcachedWrapper extends \Memcached
{
/** * Prevent adding of new servers as duplicates * * @param array $a_servers * * @return bool */publicfunctionaddServers(array$a_servers): bool
{
if (TRUE === empty($this->getServerList()))
{
returnparent::addServers($a_servers);
}
returnFALSE;
}
/** * Prevent adding of new server as duplicate * * @param string $s_host * @param mixed $m_port * @param int $i_weight * * @return bool */publicfunctionaddServer($s_host, $m_port, $i_weight = 0): bool
{
foreach ($this->getServerList() as$server)
{
if ($server['host'] === $s_host && (int) $server['port'] === (int) $m_port)
{
returnFALSE;
}
}
returnparent::addServer($s_host, $m_port, $i_weight);
}
}
$m = newMemcachedWrapper();
$m->addServer('localhost', 11211);
print_r($m->getVersion());
% php test.php
PHP Warning: Declaration of MemcachedWrapper::addServers(array $a_servers): bool should be compatible with Memcached::addServers($servers) in test.php on line 47
Array
(
[localhost:11211] => 1.6.7
)
Server
memcached-1.6.7
Client
PHP Version => 7.1.33-19+ubuntu16.04.1+deb.sury.org+1
PHP API => 20160303
PHP Extension => 20160303
memcached
memcached support => enabled
Version => 3.1.5
libmemcached version => 1.0.18
SASL support => yes
Session support => yes
igbinary support => yes
json support => yes
msgpack support => yes
Directive => Local Value => Master Value
memcached.compression_factor => 1.3 => 1.3
memcached.compression_threshold => 2000 => 2000
memcached.compression_type => fastlz => fastlz
memcached.default_binary_protocol => Off => Off
memcached.default_connect_timeout => 0 => 0
memcached.default_consistent_hash => Off => Off
memcached.serializer => php => php
memcached.sess_binary_protocol => On => On
memcached.sess_connect_timeout => 0 => 0
memcached.sess_consistent_hash => On => On
memcached.sess_consistent_hash_type => ketama => ketama
memcached.sess_lock_expire => 0 => 0
memcached.sess_lock_max_wait => not set => not set
memcached.sess_lock_retries => 5 => 5
memcached.sess_lock_wait => not set => not set
memcached.sess_lock_wait_max => 150 => 150
memcached.sess_lock_wait_min => 150 => 150
memcached.sess_locking => On => On
memcached.sess_number_of_replicas => 0 => 0
memcached.sess_persistent => Off => Off
memcached.sess_prefix => memc.sess.key. => memc.sess.key.
memcached.sess_randomize_replica_read => Off => Off
memcached.sess_remove_failed_servers => Off => Off
memcached.sess_sasl_password => no value => no value
memcached.sess_sasl_username => no value => no value
memcached.sess_server_failure_limit => 0 => 0
memcached.store_retry_count => 2 => 2
The text was updated successfully, but these errors were encountered:
I think this is correct. You cannot restrict the parameter type to array. It is a bug that PHP was not warning you about this before. Parameters must be contravariant in PHP.
I think this is correct. You cannot restrict the parameter type to array. It is a bug that PHP was not warning you about this before. Parameters must be contravariant in PHP.
Since upgrading from 3.1.4 to 3.1.5 we're getting warning
Server
Client
The text was updated successfully, but these errors were encountered: