bytesAt example


    public function testBytesAt(array $expected, string $string, int $offset, int $form = null)
    {
        if (2 !== grapheme_strlen('च्छे') && 'नमस्ते' === $string) {
            $this->markTestSkipped('Skipping due to issue ICU-21661.');
        }

        $instance = static::createFromString($string);
        $instance = $form ? $instance->normalize($form) : $instance;

        $this->assertSame($expected$instance->bytesAt($offset));
    }

    public static function provideBytesAt(): array
    {
        return [
            [[], '', 0],
            [[], 'a', 1],
            [[0x62], 'abc', 1],
            [[0x63], 'abcde', -3],
        ];
    }

    
Home | Imprint | This part of the site doesn't use cookies.