[ ' [ ['string|null' => '$a'] ] ], 'nullableReturnTypeInDocblock' => [ ' [ ['null|string' =>'$a'] ] ], 'nullableArgument' => [ ' [ ' [ ' [ ' [ ' [ ['string|int' => '$id1'], ['string|int' => '$name1'], ['string|int' => '$id2'], ['string|int' => '$name2'] ] ], 'arrayDestructuringInForeach' => [ ' [ ' 1, "name" => "Tom"], ["id" => 2, "name" => "Fred"], ]; // list() style list("id" => $id1, "name" => $name1) = $data[0]; // [] style ["id" => $id2, "name" => $name2] = $data[1];', 'assertions' => [ ['int' => '$id1'], ['string' => '$name1'], ['int' => '$id2'], ['string' => '$name2'] ] ], 'arrayListDestructuringInForeachWithKeys' => [ ' 1, "name" => "Tom"], ["id" => 2, "name" => "Fred"], ]; $last_id = null; $last_name = null; // list() style foreach ($data as list("id" => $id, "name" => $name)) { $last_id = $id; $last_name = $name; }', 'assertions' => [ ['null|int' => '$last_id'], ['null|string' => '$last_name'] ] ], 'arrayDestructuringInForeachWithKeys' => [ ' 1, "name" => "Tom"], ["id" => 2, "name" => "Fred"], ]; $last_id = null; $last_name = null; // [] style foreach ($data as ["id" => $id, "name" => $name]) { $last_id = $id; $last_name = $name; }', 'assertions' => [ ['null|int' => '$last_id'], ['null|string' => '$last_name'] ] ], 'iterableArg' => [ ' $iter */ function iterator(iterable $iter) : void { foreach ($iter as $val) { // } } iterator([1, 2, 3, 4]); iterator(new SplFixedArray(5));' ], 'traversableObject' => [ ' [ ' 'InaccessibleClassConstant' ], 'invalidPrivateClassConstFetchFromSubclass' => [ ' 'InaccessibleClassConstant' ], 'invalidProtectedClassConstFetch' => [ ' 'InaccessibleClassConstant' ], 'invalidIterableArg' => [ ' $iter */ function iterator(iterable $iter) : void { foreach ($iter as $val) { // } } class A { } iterator(new A());', 'error_message' => 'InvalidArgument' ] ]; } }