summaryrefslogtreecommitdiff
path: root/tests/lang/string/unicode_escape_surrogates.phpt
blob: 8ca46c8f98a0864f5083c43e55db6fcb2b203344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--TEST--
Valid Unicode escape sequences: Surrogate halves
--FILE--
<?php

// Surrogate pairs are non-well-formed UTF-8 - however, it is sometimes useful
// to be able to produce these (e.g. CESU-8 handling)

var_dump(bin2hex("\u{D801}"));
var_dump(bin2hex("\u{DC00}"));
var_dump(bin2hex("\u{D801}\u{DC00}")); // CESU-8 encoding of U+10400
?>
--EXPECT--
string(6) "eda081"
string(6) "edb080"
string(12) "eda081edb080"