3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); $a = [ [ 'id' => 1, 'name' => 'Eriri' ], [ 'id' => 2, 'name' => 'Utaha' ], [ 'id' => 3, 'name' => 'Megumi' ], [ 'id' => 4, 'name' => 'Izumi' ], [ 'id' => 5, 'name' => 'Michiru' ] ]; foreach ($a as ['id' => $id, 'name' => $name]) { echo "{$id}:{$name}\n"; }
based on GE3Sm
Output for 7.1.0 - 7.2.6
1:Eriri 2:Utaha 3:Megumi 4:Izumi 5:Michiru
Output for 7.0.0 - 7.0.27
Parse error: syntax error, unexpected ')', expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in /in/9v5jp on line 12
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: syntax error, unexpected ')', expecting '(' in /in/9v5jp:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: syntax error, unexpected ')', expecting '(' in /in/9v5jp:12 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/9v5jp on line 2 Parse error: syntax error, unexpected '[' in /in/9v5jp on line 12
Process exited with code 255.