docString.test 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. Nowdoc and heredoc strings
  2. -----
  3. <?php
  4. // empty strings
  5. <<<'EOS'
  6. EOS;
  7. <<<EOS
  8. EOS;
  9. // constant encapsed strings
  10. <<<'EOS'
  11. Test '" $a \n
  12. EOS;
  13. <<<EOS
  14. Test '" \$a \n
  15. EOS;
  16. // encapsed strings
  17. <<<EOS
  18. Test $a
  19. EOS;
  20. <<<EOS
  21. Test $a and $b->c test
  22. EOS;
  23. b<<<EOS
  24. Binary
  25. EOS;
  26. -----
  27. array(
  28. 0: Scalar_String(
  29. value:
  30. comments: array(
  31. 0: // empty strings
  32. )
  33. )
  34. 1: Scalar_String(
  35. value:
  36. )
  37. 2: Scalar_String(
  38. value: Test '" $a \n
  39. comments: array(
  40. 0: // constant encapsed strings
  41. )
  42. )
  43. 3: Scalar_String(
  44. value: Test '" $a
  45. )
  46. 4: Scalar_Encapsed(
  47. parts: array(
  48. 0: Scalar_EncapsedStringPart(
  49. value: Test
  50. )
  51. 1: Expr_Variable(
  52. name: a
  53. )
  54. )
  55. comments: array(
  56. 0: // encapsed strings
  57. )
  58. )
  59. 5: Scalar_Encapsed(
  60. parts: array(
  61. 0: Scalar_EncapsedStringPart(
  62. value: Test
  63. )
  64. 1: Expr_Variable(
  65. name: a
  66. )
  67. 2: Scalar_EncapsedStringPart(
  68. value: and
  69. )
  70. 3: Expr_PropertyFetch(
  71. var: Expr_Variable(
  72. name: b
  73. )
  74. name: c
  75. )
  76. 4: Scalar_EncapsedStringPart(
  77. value: test
  78. )
  79. )
  80. )
  81. 6: Scalar_String(
  82. value: Binary
  83. )
  84. )