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

Breadcrumb

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

function Preg::splitWithOffsets

@phpstan-return list<array{string, int<0, max>}>

Parameters

int-mask<PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_OFFSET_CAPTURE> $flags PREG_SPLIT_NO_EMPTY or PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE is always set:

Return value

list<array{string, int}>

File

vendor/composer/pcre/src/Preg.php, line 263

Class

Preg

Namespace

Composer\Pcre

Code

public static function splitWithOffsets(string $pattern, string $subject, int $limit = -1, int $flags = 0) : array {
    $result = preg_split($pattern, $subject, $limit, $flags | PREG_SPLIT_OFFSET_CAPTURE);
    if ($result === false) {
        throw PcreException::fromFunction('preg_split', $pattern);
    }
    return $result;
}
RSS feed
Powered by Drupal