1
0
mirror of https://github.com/php/php-src.git synced 2026-04-12 02:23:18 +02:00
Files
archived-php-src/tests/lang/string/unicode_escape_surrogates.phpt
Máté Kocsis 7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00

17 lines
417 B
PHP

--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"