Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PcreException.php

function PcreException::fromFunction

Parameters

string $function:

string|string[] $pattern:

Return value

self

10 calls to PcreException::fromFunction()
Preg::grep in vendor/composer/pcre/src/Preg.php
@template T of string|\Stringable
Preg::match in vendor/composer/pcre/src/Preg.php
@param-out array<int|string, string|null> $matches
Preg::matchAll in vendor/composer/pcre/src/Preg.php
@param-out array<int|string, list<string|null>> $matches
Preg::matchAllWithOffsets in vendor/composer/pcre/src/Preg.php
Runs preg_match_all with PREG_OFFSET_CAPTURE
Preg::matchWithOffsets in vendor/composer/pcre/src/Preg.php
Runs preg_match with PREG_OFFSET_CAPTURE

... See full list

1 method overrides PcreException::fromFunction()
UnexpectedNullMatchException::fromFunction in vendor/composer/pcre/src/UnexpectedNullMatchException.php

File

vendor/composer/pcre/src/PcreException.php, line 21

Class

PcreException

Namespace

Composer\Pcre

Code

public static function fromFunction($function, $pattern) {
    $code = preg_last_error();
    if (is_array($pattern)) {
        $pattern = implode(', ', $pattern);
    }
    return new PcreException($function . '(): failed executing "' . $pattern . '": ' . self::pcreLastErrorMessage($code), $code);
}
RSS feed
Powered by Drupal