Skip to content

Instantly share code, notes, and snippets.

@andreia
Created December 21, 2019 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreia/7b02ab6402f3844ea8b7b4e539f4611e to your computer and use it in GitHub Desktop.
Save andreia/7b02ab6402f3844ea8b7b4e539f4611e to your computer and use it in GitHub Desktop.
<?php
use Symfony\Component\String\ByteString;
use Symfony\Component\String\CodePointString;
use Symfony\Component\String\UnicodeString;
$content = new CodePointString('Hello world');
$content = new UnicodeString('नमस्ते दुनिया');
$content = new ByteString('さよなら');
$content = (new CodePointString('hello'))->toUnicodeString();
$content = UnicodeString::fromCodePoints(0x68, 0x65, 0x6C, 0x6C, 0x6F)->toByteString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment