unicodeEscape.test 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. Unicode escape sequence
  2. -----
  3. <?php
  4. "\u{0}";
  5. "\u{114}$foo";
  6. `\u{1F602}$bar`;
  7. -----
  8. array(
  9. 0: Stmt_Expression(
  10. expr: Scalar_String(
  11. value: @@{"\0"}@@
  12. )
  13. )
  14. 1: Stmt_Expression(
  15. expr: Scalar_InterpolatedString(
  16. parts: array(
  17. 0: InterpolatedStringPart(
  18. value: Ĕ
  19. )
  20. 1: Expr_Variable(
  21. name: foo
  22. )
  23. )
  24. )
  25. )
  26. 2: Stmt_Expression(
  27. expr: Expr_ShellExec(
  28. parts: array(
  29. 0: InterpolatedStringPart(
  30. value: @@{"\xF0\x9F\x98\x82"}@@
  31. )
  32. 1: Expr_Variable(
  33. name: bar
  34. )
  35. )
  36. )
  37. )
  38. )
  39. -----
  40. <?php
  41. "\u{0}";
  42. "\u{114}$foo";
  43. `\u{1F602}$bar`;
  44. -----
  45. !!version=5.6
  46. array(
  47. 0: Stmt_Expression(
  48. expr: Scalar_String(
  49. value: \u{0}
  50. )
  51. )
  52. 1: Stmt_Expression(
  53. expr: Scalar_InterpolatedString(
  54. parts: array(
  55. 0: InterpolatedStringPart(
  56. value: \u{114}
  57. )
  58. 1: Expr_Variable(
  59. name: foo
  60. )
  61. )
  62. )
  63. )
  64. 2: Stmt_Expression(
  65. expr: Expr_ShellExec(
  66. parts: array(
  67. 0: InterpolatedStringPart(
  68. value: \u{1F602}
  69. )
  70. 1: Expr_Variable(
  71. name: bar
  72. )
  73. )
  74. )
  75. )
  76. )
  77. -----
  78. <?php
  79. "\u{FFFFFFFFFFFFFFFF}";
  80. -----
  81. Invalid UTF-8 codepoint escape sequence: Codepoint too large on line 2