3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 'a,b,c,d,e,f'; function g($a) { echo 'in'; yield from preg_split('/,/' , $a); echo 'ou'; }; foreach (g($a) as $t) { var_dump($t); }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
instring(1) "a" string(1) "b" string(1) "c" string(1) "d" string(1) "e" string(1) "f" ou

preferences:
129.14 ms | 404 KiB | 174 Q