A WordPress-centric search engine for devs and theme authors



_wp_can_use_pcre_u ›

Since4.2.2
Deprecatedn/a
_wp_can_use_pcre_u ( $set = null )
Access:
  • private
Parameters:
  • (bool) $set - 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
    Required: No
    Default: null
Defined at:
Codex:

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



Source

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

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

	if ( 'reset' === $utf8_pcre ) {
		$utf8_pcre = @preg_match( '/^./u', 'a' );
	}

	return $utf8_pcre;
}