3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $time_variant = array( 'group_a' => array( '0' => array( 'id_variant' => 122, 'name' => '3 hour 30 min', 'time' => 12600 ), '1' => array( 'id_variant' => 173, 'name' => '3 hour', 'time' => 10800 ), '2' => array( 'id_variant' => 271, 'name' => '1 hour', 'time' => 3600 ), ), 'group_b' => array( '0' => array( 'id_variant' => 107, 'name' => '1 hour 30 min', 'time' => 5400 ), '1' => array( 'id_variant' => 321, 'name' => '3 hour', 'time' => 10800 ), ), 'group_c' => array( '0' => array( 'id_variant' => 28, 'name' => '1 hour', 'time' => 3600 ), '1' => array( 'id_variant' => 98, 'name' => '3 hour', 'time' => 10800 ), '2' => array( 'id_variant'] => 157, 'name' => '2 hour', 'time' => 7200 ), '3' => array( 'id_variant' => 158, 'name' => '1 hour 30 min', 'time' => 5400 ), ), ); $result = array( ['0'] => array( ['id_variant'] => 173, // mo matter - 173, 321 or 98 ['name'] => '3 hour', ['time'] => 10800 ), );
Output for 5.3.0 - 5.5.6
Parse error: syntax error, unexpected ']', expecting ')' in /in/1UQm6 on line 45
Process exited with code 255.