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

Breadcrumb

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

function Preg::replace

@param-out int<0, max> $count

Parameters

string|string[] $pattern:

string|string[] $replacement:

string $subject:

int $count Set by method:

93 calls to Preg::replace()
ArchivableFilesFinder::__construct in vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php
Initializes the internal Symfony Finder with appropriate filters
ArchiveManager::getPackageFilenameParts in vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php
@internal
ArrayLoader::configureObject in vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php
ArrayLoader::getBranchAlias in vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php
Retrieves a branch alias (dev-master => 1.0.x-dev for example) if it exists
AutoloadGenerator::buildExclusionRegex in vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php

... See full list

File

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

Class

Preg

Namespace

Composer\Pcre

Code

public static function replace($pattern, $replacement, $subject, int $limit = -1, ?int &$count = null) : string {
    if (!is_scalar($subject)) {
        if (is_array($subject)) {
            throw new \InvalidArgumentException(static::ARRAY_MSG);
        }
        throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject)));
    }
    $result = preg_replace($pattern, $replacement, $subject, $limit, $count);
    if ($result === null) {
        throw PcreException::fromFunction('preg_replace', $pattern);
    }
    return $result;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal