3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Get Smart - TV comedy debuted 1965 $agents = array( array(86 => "Don Adams"), array(99 => "Barbara Feldon"), array(08 => "Burt Mustin"), array(13 => "Dave Ketchum"), array(44 => "Victor French"), array(38 => "Angelique Pettyjohn") ); echo "The secret agents and the actors who portrayed them:"; foreach ($agents as list( $agent,$actor ) ) { echo $actor, ' => ', $agent; }
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
The secret agents and the actors who portrayed them: Notice: Undefined offset: 1 in /in/FLRAi on line 14 Notice: Undefined offset: 0 in /in/FLRAi on line 14 => Notice: Undefined offset: 1 in /in/FLRAi on line 14 Notice: Undefined offset: 0 in /in/FLRAi on line 14 => Notice: Undefined offset: 1 in /in/FLRAi on line 14 => Burt Mustin Notice: Undefined offset: 1 in /in/FLRAi on line 14 Notice: Undefined offset: 0 in /in/FLRAi on line 14 => Notice: Undefined offset: 1 in /in/FLRAi on line 14 Notice: Undefined offset: 0 in /in/FLRAi on line 14 => Notice: Undefined offset: 1 in /in/FLRAi on line 14 Notice: Undefined offset: 0 in /in/FLRAi on line 14 =>
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected 'list' (T_LIST) in /in/FLRAi on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_LIST in /in/FLRAi on line 14
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_LIST, expecting '&' or T_STRING or T_VARIABLE or '$' in /in/FLRAi on line 14
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_LIST, expecting '&' or T_STRING or T_VARIABLE or '$' in /in/FLRAi on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_LIST, expecting T_VARIABLE or '$' in /in/FLRAi on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_LIST, expecting T_VARIABLE or '$' in /in/FLRAi on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/FLRAi on line 14
Process exited with code 255.

preferences:
213.56 ms | 1395 KiB | 133 Q