Contact: aviboots(AT)netvision.net.il
43,952 questions
57,376 answers
573 users
declare(strict_types=1); function numbers(): \Generator { yield 1; yield 2; yield "3"; // Allowed: generator yields are not type‑checked } foreach (numbers() as $n) { echo $n; // "3" is allowed here } /* run: 123 */