Supported Versions: PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8
Get string length
mb_strlen(string $string, ?string $encoding null): int
            case 'string':

                
$this->type self::TYPE_STRING;

                
$this->class preg_match('//u'$value) ? self::STRING_UTF8 self::STRING_BINARY;

                
$this->cut self::STRING_BINARY === $this->class \strlen($value) : mb_strlen($value'UTF-8');

                
$this->value '';

                break;

        }
                            } else {

                                
$stub->value $v;

                            }

                        } elseif (
<= $maxString && isset($v[+ ($maxString >> 2)]) && $cut mb_strlen($v'UTF-8') - $maxString) {

                            
$stub = new Stub();

                            
$stub->type Stub::TYPE_STRING;

                            
$stub->class Stub::STRING_UTF8;
            $this->endValue($cursor);

        } else {

            
$attr += [

                
'length' => <= $cut mb_strlen($str'UTF-8') + $cut 0,

                
'binary' => $bin,

            ];

            
$str $bin && false !== strpos($str"\0") ? [$str] : explode("\n"$str);
                if ($i $m) {

                    
$str .= "\n";

                }

                if (
$this->maxStringWidth && $this->maxStringWidth $len mb_strlen($str'UTF-8')) {

                    
$str mb_substr($str0$this->maxStringWidth'UTF-8');

                    
$lineCut $len $this->maxStringWidth;

                }