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 apc_add and apc_store can accept a string or array for the key, when a string is supplied a var must also be applied, otherwise when key is an array it is handled as a key:var paired array
$cache->apc_add(['Hello' => 'World']); results in an exception being thrown.
publicfunction apc_add($key, $var = null, $ttl = 0)
{
if (is_array($key) && $var === null) {
thrownew \InvalidArgumentException('When $key is set $var cannot be null');
}
should be something like
publicfunction apc_add($key, $var = null, $ttl = 0)
{
if (is_string($key) && $var === null) {
thrownew \InvalidArgumentException('When $key is set $var cannot be null');
} elseif (is_array($key) && $var !== null) {
thrownew \InvalidArgumentException('When $key is an array $var must be null');
}
Since
apc_add
andapc_store
can accept a string or array for the key, when a string is supplied a var must also be applied, otherwise when key is an array it is handled as a key:var paired array$cache->apc_add(['Hello' => 'World']);
results in an exception being thrown.should be something like
reference: http://php.net/manual/en/function.apcu-add.php
The text was updated successfully, but these errors were encountered: