3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function(){ yield [1,2,3] => [4,5,6]; }; foreach($a() as [$x1, $x2, $x3] => [$x4, $x5, $x6]){ var_dump($x1, $x2, $x3, $x4, $x5, $x6); }
Output for 7.1.0 - 7.1.3
Fatal error: Cannot use list as key element in /in/r2vrs on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.17
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /in/r2vrs on line 7
Process exited with code 255.

preferences:
161.7 ms | 1405 KiB | 29 Q