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

Breadcrumb

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

function Platform::strlen

Return value

int return a guaranteed binary length of the string, regardless of silly mbstring configs

5 calls to Platform::strlen()
CurlDownloader::tick in vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php
GzipDownloader::extractUsingExt in vendor/composer/composer/src/Composer/Downloader/GzipDownloader.php
RemoteFilesystem::get in vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php
Get file content or copy action.
RemoteFilesystem::getRemoteContents in vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php
Get contents of remote URL.
VersionBumper::bumpRequirement in vendor/composer/composer/src/Composer/Package/Version/VersionBumper.php
Given a constraint, this returns a new constraint with the lower bound bumped to match the given package's version.

File

vendor/composer/composer/src/Composer/Util/Platform.php, line 231

Class

Platform
Platform helper for uniform platform-specific tests.

Namespace

Composer\Util

Code

public static function strlen(string $str) : int {
    static $useMbString = null;
    if (null === $useMbString) {
        $useMbString = \function_exists('mb_strlen') && (bool) ini_get('mbstring.func_overload');
    }
    if ($useMbString) {
        return mb_strlen($str, '8bit');
    }
    return \strlen($str);
}

API Navigation

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