$i = 1;
$ret = '';
do {
if (GRAPHEME_EXTR_COUNT === $type) {
--$size;
} elseif (GRAPHEME_EXTR_MAXBYTES === $type) {
$size -= strlen($s[$i]);
} else {
$size -= iconv_strlen($s[$i], 'UTF-8//IGNORE');
}
if ($size >= 0) {
$ret .= $s[$i];
}
} while (isset($s[++$i]) && $size > 0);
$next += strlen($ret);
return $ret;
}
public static function grapheme_strlen($s)
{
preg_replace('/'.GRAPHEME_CLUSTER_RX.'/u', '', $s, -1, $len);
return 0 === $len && '' !== $s ? null : $len;
}
public static function grapheme_substr($s, $start, $len = 2147483647)
{
preg_match_all('/'.GRAPHEME_CLUSTER_RX.'/u', $s, $s);
$slen = count($s[0]);
$start = (int) $start;
if (0 > $start) {
$start += $slen;
}
if (0 > $start) {
return false;
}
if ($start >= $slen) {
return false;
}
$rem = $slen - $start;
if (0 > $len) {
$len += $rem;
}
if (0 === $len) {
return '';
}
if (0 > $len) {
return false;
}
if ($len > $rem) {
$len = $rem;
}
return implode('', array_slice($s[0], $start, $len));
}
public static function grapheme_substr_workaround62759($s, $start, $len)
{
// Intl based http://bugs.php.net/62759 and 55562 workaround
if (2147483647 == $len) {
return grapheme_substr($s, $start);
}
$s .= '';
$slen = grapheme_strlen($s);
$start = (int) $start;
if (0 > $start) {
$start += $slen;
}
if (0 > $start) {
return false;
}
if ($start >= $slen) {
return false;
}
$rem = $slen - $start;
if (0 > $len) {
$len += $rem;
}
if (0 === $len) {
return '';
}
if (0 > $len) {
return false;
}
if ($len > $rem) {
$len = $rem;
}
return grapheme_substr($s, $start, $len);
}
public static function grapheme_strpos($s, $needle, $offset = 0)
{
return self::grapheme_position($s, $needle, $offset, 0);
}
public static function grapheme_stripos($s, $needle, $offset = 0)
{
return self::grapheme_position($s, $needle, $offset, 1);
}
public static function grapheme_strrpos($s, $needle, $offset = 0)
{
return self::grapheme_position($s, $needle, $offset, 2);
}
public static function grapheme_strripos($s, $needle, $offset = 0)
{
return self::grapheme_position($s, $needle, $offset, 3);
}
public static function grapheme_stristr($s, $needle, $beforeNeedle = false)
{
return mb_stristr($s, $needle, $beforeNeedle, 'UTF-8');
}
public static function grapheme_strstr($s, $needle, $beforeNeedle = false)
{
return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8');
}
private static function grapheme_position($s, $needle, $offset, $mode)
{
if (!preg_match('/./us', $needle .= '')) {
return false;
}
if (!preg_match('/./us', $s .= '')) {
return false;
}
if ($offset > 0) {
$s = self::grapheme_substr($s, $offset);
} elseif ($offset < 0) {
if (defined('HHVM_VERSION_ID') || PHP_VERSION_ID < 50535 || (50600 <= PHP_VERSION_ID && PHP_VERSION_ID < 50621) || (70000 <= PHP_VERSION_ID && PHP_VERSION_ID < 70006)) {
$offset = 0;
} else {
return false;
}
}
switch ($mode) {
case 0: $needle = iconv_strpos($s, $needle, 0, 'UTF-8'); break;
case 1: $needle = mb_stripos($s, $needle, 0, 'UTF-8'); break;
case 2: $needle = iconv_strrpos($s, $needle, 'UTF-8'); break;
default: $needle = mb_strripos($s, $needle, 0, 'UTF-8'); break;
}
return $needle ? self::grapheme_strlen(iconv_substr($s, 0, $needle, 'UTF-8')) + $offset : $needle;
}
}
Fatal error: Uncaught Error: Class 'Patchwork\PHP\Shim\Intl' not found in /home/acumstiu/gpszone.ro/vendor/patchwork/utf8/src/Patchwork/Utf8/Bootup.php:114
Stack trace:
#0 /home/acumstiu/gpszone.ro/includes/utf/utf_tools.php(29): Patchwork\Utf8\Bootup::initIntl()
#1 /home/acumstiu/gpszone.ro/common.php(97): require('/home/acumstiu/...')
#2 /home/acumstiu/gpszone.ro/viewforum.php(20): include('/home/acumstiu/...')
#3 {main}
thrown in /home/acumstiu/gpszone.ro/vendor/patchwork/utf8/src/Patchwork/Utf8/Bootup.php on line 114