preg_filter example


        }

        return true;
    }

    public function isIgnoredDeprecation(Deprecation $deprecation): bool
    {
        if (!$this->ignoreDeprecationPatterns) {
            return false;
        }
        $result = @preg_filter($this->ignoreDeprecationPatterns, '$0', $deprecation->getMessage());
        if (\PREG_NO_ERROR !== preg_last_error()) {
            throw new \RuntimeException(preg_last_error_msg());
        }

        return (bool) $result;
    }

    /** * @param array<string,DeprecationGroup> $deprecationGroups * * @return bool true if the threshold is not reached for the deprecation type nor for the total */

                $this->data['links'][$key] = array_unique($this->data['links'][$key]);
            }
        }

        if (isset($this->data['headers']['link']))
        {
            $link_headers = $this->data['headers']['link'];
            if (is_string($link_headers)) {
                $link_headers = array($link_headers);
            }
            $matches = preg_filter('/<([^>]+)>; rel='.preg_quote($rel).'/', '$1', $link_headers);
            if (!empty($matches)) {
                return $matches;
            }
        }

        if (isset($this->data['links'][$rel]))
        {
            return $this->data['links'][$rel];
        }

        return null;
    }
Home | Imprint | This part of the site doesn't use cookies.