MCPcopy Create free account
hub / github.com/z7zmey/php-parser / TestArrayItemUnpack

Function TestArrayItemUnpack

node/expr/t_array_test.go:222–284  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

220}
221
222func TestArrayItemUnpack(t *testing.T) {
223 src := `<? array(...$b);`
224
225 expected := &node.Root{
226 Position: &position.Position{
227 StartLine: 1,
228 EndLine: 1,
229 StartPos: 3,
230 EndPos: 16,
231 },
232 Stmts: []node.Node{
233 &stmt.Expression{
234 Position: &position.Position{
235 StartLine: 1,
236 EndLine: 1,
237 StartPos: 3,
238 EndPos: 16,
239 },
240 Expr: &expr.Array{
241 Position: &position.Position{
242 StartLine: 1,
243 EndLine: 1,
244 StartPos: 3,
245 EndPos: 15,
246 },
247 Items: []node.Node{
248 &expr.ArrayItem{
249 Position: &position.Position{
250 StartLine: 1,
251 EndLine: 1,
252 StartPos: 9,
253 EndPos: 14,
254 },
255 Unpack: true,
256 Val: &expr.Variable{
257 Position: &position.Position{
258 StartLine: 1,
259 EndLine: 1,
260 StartPos: 12,
261 EndPos: 14,
262 },
263 VarName: &node.Identifier{
264 Position: &position.Position{
265 StartLine: 1,
266 EndLine: 1,
267 StartPos: 12,
268 EndPos: 14,
269 },
270 Value: "b",
271 },
272 },
273 },
274 },
275 },
276 },
277 },
278 }
279

Callers

nothing calls this directly

Calls 3

ParseMethod · 0.95
GetRootNodeMethod · 0.95
NewParserFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…