Invalid UTF-8 codepoint escape: Codepoint too large

Description

PHP supports unicode as escape sequence. They are used in double-quoted strings, and use the \u{73} format. The digits must represent a valid unicode codepoint: here, 73 represents the ASCII letter s.

When a valid escape sequence is detected, PHP use the integer between the curly braces. Unicode comprises 1,114,112 code points in the range 0 to 10FFFF. Beyond that value, codepoint are undefined, and do not represent anything anymore.

Example

<?php
  $a = "\u{ffffff}";
?>

Solutions

  • Check the values inside the curly braces: chances are it needs to be replaced with smaller values.

See Also