src/includes/traits/CacheMembers.php
protected function cacheUnsetPattern(string $primary_key, string $sub_key_pattern)
    {
        if ($primary_key === 'x___keys' || $primary_key === 'x___refs') {
            throw $this->c::issue('Attempting to unset a reserved primary key.');
        }
        if (empty($this->x___cache[$primary_key])) {
            return; // Nothing to do here.
        }
        $sub_key_regex = // Allow `**` to indicate everything quickly.
            $sub_key_pattern === '**' ? '' : $this->c::wRegx($sub_key_pattern, '/', true);

        if (!$sub_key_regex && $sub_key_pattern !== '**') {
            return; // Nothing to do; i.e., no regex.
        }
        foreach (array_keys($this->x___cache[$primary_key]) as $_sub_key) {
            if ($sub_key_pattern === '**' || preg_match($sub_key_regex.'i', (string) $_sub_key)) {
                $this->x___cache[$primary_key][$_sub_key] = null;
                unset($this->x___cache[$primary_key][$_sub_key]);
            }
        } // unset($_sub_key); // Housekeeping.
    }
protected function cacheUnsetPattern(string $primary_key, string $sub_key_pattern)
    {
        if ($primary_key === 'x___keys' || $primary_key === 'x___refs') {
            throw $this->c::issue('Attempting to unset a reserved primary key.');
        }
        if (empty($this->x___cache[$primary_key])) {
            return; // Nothing to do here.
        }
        $sub_key_regex = // Allow `**` to indicate everything quickly.
            $sub_key_pattern === '**' ? '' : $this->c::wRegx($sub_key_pattern, '/', true);

        if (!$sub_key_regex && $sub_key_pattern !== '**') {
            return; // Nothing to do; i.e., no regex.
        }
        foreach (array_keys($this->x___cache[$primary_key]) as $_sub_key) {
            if ($sub_key_pattern === '**' || preg_match($sub_key_regex.'i', (string) $_sub_key)) {
                $this->x___cache[$primary_key][$_sub_key] = null;
                unset($this->x___cache[$primary_key][$_sub_key]);
            }
        } // unset($_sub_key); // Housekeeping.
    }
Unset a cache sub-key pattern.

@since 150424 Initial release.

@param string $primary_key     Primary key.
@param string $sub_key_pattern Sub-key pattern (watered-down regex).