PHP 7 introduced Unicode Codepoint Escape Syntax which is very easy to use, but I can't get it to work with a variable as a codepoint.
echo "\u{1f602}"; // echoes
$em = "1f602";
echo sprintf("\u{%x}", $em); // returns error "Invalid UTF-8 codepoint escape sequence"
What am I doing wrong ?