Automattic\WooCommerce\Vendor\Symfony\Polyfill\Php80

Php80::preg_last_error_msgpublic staticWC 1.0

Method of the class: Php80{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Php80::preg_last_error_msg(): string;

Php80::preg_last_error_msg() code WC 10.5.0

public static function preg_last_error_msg(): string
{
    switch (preg_last_error()) {
        case \PREG_INTERNAL_ERROR:
            return 'Internal error';
        case \PREG_BAD_UTF8_ERROR:
            return 'Malformed UTF-8 characters, possibly incorrectly encoded';
        case \PREG_BAD_UTF8_OFFSET_ERROR:
            return 'The offset did not correspond to the beginning of a valid UTF-8 code point';
        case \PREG_BACKTRACK_LIMIT_ERROR:
            return 'Backtrack limit exhausted';
        case \PREG_RECURSION_LIMIT_ERROR:
            return 'Recursion limit exhausted';
        case \PREG_JIT_STACKLIMIT_ERROR:
            return 'JIT stack limit exhausted';
        case \PREG_NO_ERROR:
            return 'No error';
        default:
            return 'Unknown error';
    }
}