Hash :
5d7223c9
Author :
Date :
2018-03-03T21:39:51
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
"This $variable is interpolated"
"$foo[2], $bar[-4], $foo[$bar]"
"$foo->bar"
"More {$interpolation}"
"{$arr['key']}, {$arr['foo'][3]}"
"{${$name}}, but not {\${\$name}}"
"the return value of getName(): {${getName()}}"
"the return value of \$object->getName(): {${$object->getName()}}"
"{$foo->$bar}, {$foo->{$baz[1]}}"
<<<FOO
Heredoc strings $also->support {${$string->interpolation()}}
FOO;
<<<"FOO_BAR"
{${$name}}, but not {\${\$name}}
FOO_BAR;
----------------------------------------------------
[
["double-quoted-string", [
"\"This ",
["interpolation", [["variable", "$variable"]]],
" is interpolated\""
]],
["double-quoted-string", [
"\"",
["interpolation", [["variable", "$foo"], ["punctuation", "["], ["number", "2"], ["punctuation", "]"]]],
", ",
["interpolation", [["variable", "$bar"], ["punctuation", "["], ["operator", "-"], ["number", "4"], ["punctuation", "]"]]],
", ",
["interpolation", [["variable", "$foo"], ["punctuation", "["], ["variable", "$bar"], ["punctuation", "]"]]],
"\""
]],
["double-quoted-string", [
"\"",
["interpolation", [["variable", "$foo"], ["operator", "-"], ["operator", ">"], ["property", "bar"]]],
"\""
]],
["double-quoted-string", [
"\"More ",
["interpolation", [["punctuation", "{"], ["variable", "$interpolation"], ["punctuation", "}"]]],
"\""
]],
["double-quoted-string", [
"\"",
["interpolation", [
["punctuation", "{"],
["variable", "$arr"], ["punctuation", "["], ["single-quoted-string", "'key'"], ["punctuation", "]"],
["punctuation", "}"]
]],
", ",
["interpolation", [
["punctuation", "{"],
["variable", "$arr"],
["punctuation", "["], ["single-quoted-string", "'foo'"], ["punctuation", "]"],
["punctuation", "["], ["number", "3"], ["punctuation", "]"],
["punctuation", "}"]
]],
"\""
]],
["double-quoted-string", [
"\"",
["interpolation", [
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"],
["variable", "$name"],
["punctuation", "}"], ["punctuation", "}"]
]],
", but not {\\${\\$name}}\""
]],
["double-quoted-string", [
"\"the return value of getName(): ",
["interpolation", [
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"],
["function", "getName"], ["punctuation", "("], ["punctuation", ")"],
["punctuation", "}"], ["punctuation", "}"]
]],
"\""
]],
["double-quoted-string", [
"\"the return value of \\$object->getName(): ",
["interpolation", [
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"],
["variable", "$object"], ["operator", "-"], ["operator", ">"], ["function", "getName"], ["punctuation", "("], ["punctuation", ")"],
["punctuation", "}"], ["punctuation", "}"]
]],
"\""
]],
["double-quoted-string", [
"\"",
["interpolation", [
["punctuation", "{"],
["variable", "$foo"], ["operator", "-"], ["operator", ">"], ["variable", "$bar"],
["punctuation", "}"]
]],
", ",
["interpolation", [
["punctuation", "{"],
["variable", "$foo"], ["operator", "-"], ["operator", ">"], ["punctuation", "{"],
["variable", "$baz"], ["punctuation", "["], ["number", "1"], ["punctuation", "]"],
["punctuation", "}"],
["punctuation", "}"]
]],
"\""
]],
["heredoc-string", [
["delimiter", [
["punctuation", "<<<"], "FOO"
]],
"\r\nHeredoc strings ",
["interpolation", [
["variable", "$also"], ["operator", "-"], ["operator", ">"], ["property", "support"]
]],
["interpolation", [
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"],
["variable", "$string"], ["operator", "-"], ["operator", ">"], ["function", "interpolation"], ["punctuation", "("], ["punctuation", ")"],
["punctuation", "}"], ["punctuation", "}"]
]],
["delimiter", [
"FOO", ["punctuation", ";"]
]]
]],
["heredoc-string", [
["delimiter", [
["punctuation", "<<<\""], "FOO_BAR", ["punctuation", "\""]
]],
["interpolation", [
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"],
["variable", "$name"],
["punctuation", "}"], ["punctuation", "}"]
]],
", but not {\\${\\$name}}\r\n",
["delimiter", [
"FOO_BAR", ["punctuation", ";"]
]]
]]
]
----------------------------------------------------
Checks for interpolation inside strings.