WordPress at Your Fingertips
function is not described

_wp_can_use_pcre_u() WP 4.2.2

Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

null. Nothing.

Usage

_wp_can_use_pcre_u( $set );
$set(true|false)
- Used for testing only null : default - get PCRE/u capability false : Used for testing - return false for future calls to this function 'reset': Used for testing - restore default behavior of this function

Changelog

Since 4.2.2 Introduced.

Code of _wp_can_use_pcre_u() WP 5.8

<?php
function _wp_can_use_pcre_u( $set = null ) {
	static $utf8_pcre = 'reset';

	if ( null !== $set ) {
		$utf8_pcre = $set;
	}

	if ( 'reset' === $utf8_pcre ) {
		// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- intentional error generated to detect PCRE/u support.
		$utf8_pcre = @preg_match( '/^./u', 'a' );
	}

	return $utf8_pcre;
}