Array union, lingering references, generators and late static binding.
<?php $a = [1, 2]; $b = [3, 4, 5]; echo implode(",", $a + $b), " | ", implode(",", array_merge($a, $b));
<?php $items = [1, 2, 3]; foreach ($items as &$item) { } foreach ($items as $item) { } echo implode(",", $items);
<?php function gen() { echo "A"; yield 1; echo "B"; yield 2; echo "C"; } foreach (gen() as $value) { echo $value; }
<?php class Model { public static function viaStatic(): static { return new static; } public static function viaSelf(): self { return new self; } } class User extends Model {} echo get_class(User::viaStatic()), " ", get_class(User::viaSelf());
<?php $data = ["key" => null]; echo isset($data["key"]) ? "set" : "not set"; echo " / "; echo array_key_exists("key", $data) ? "exists" : "missing";
Answers are scored on the server. Unanswered questions count as incorrect.