3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $users = array(array('name' => 'a'), array('name' => 'b'), array('name' => 'c'), array('name' => 'd'), array('name' => 'e'), array('name' => 'f'), array('name' => 'g') ); $firstNames = [foreach ($users as $user) yield $user['name']];
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected 'foreach' (T_FOREACH), expecting ']' in /in/BOWTQ on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.22
Parse error: syntax error, unexpected '[' in /in/BOWTQ on line 12
Process exited with code 255.