WordPress at a glance
function is not described

RandomCompat_strlen() WP 1.0

strlen() implementation that isn't brittle to mbstring.func_overload

This version uses mb_strlen() in '8bit' mode to treat strings as raw binary rather than UTF-8, ISO-8859-1, etc

No Hooks.

Return

Int.

Usage

RandomCompat_strlen( $binary_string );
$binary_string(string) (required)

Code of RandomCompat strlen: wp-includes/random_compat/byte_safe_strings.php VER 5.0.3

<?php
function RandomCompat_strlen($binary_string)
{
    if (!is_string($binary_string)) {
        throw new TypeError(
            'RandomCompat_strlen() expects a string'
        );
    }

    return mb_strlen($binary_string, '8bit');
}

    } else {
/**
 * strlen() implementation that isn't brittle to mbstring.func_overload
 *
 * This version just used the default strlen()
 *
 * @param string $binary_string
 *
 * @throws TypeError
 *
 * @return int
 */
function RandomCompat_strlen($binary_string)
{
    if (!is_string($binary_string)) {
        throw new TypeError(
            'RandomCompat_strlen() expects a string'
        );
    }
    return strlen($binary_string);
}