3v4l.org

run code in 150+ 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.4.0 - 5.6.28
Warning: Illegal offset type in /in/DmRZU on line 7 Warning: Illegal offset type in /in/DmRZU on line 9 Warning: Illegal offset type in /in/DmRZU on line 11 Warning: Illegal offset type in /in/DmRZU on line 12 Warning: Illegal offset type in /in/DmRZU on line 14 Warning: Illegal offset type in /in/DmRZU on line 14 Warning: Illegal offset type in /in/DmRZU on line 16 Warning: Illegal offset type in /in/DmRZU on line 17 Warning: Illegal offset type in /in/DmRZU on line 19 Warning: Illegal offset type in /in/DmRZU on line 19 Warning: Illegal offset type in /in/DmRZU on line 23 Warning: Illegal offset type in /in/DmRZU on line 24 Warning: Illegal offset type in /in/DmRZU on line 26 Warning: Illegal offset type in /in/DmRZU on line 26 Warning: Illegal offset type in /in/DmRZU on line 28 Warning: Illegal offset type in /in/DmRZU on line 29 Warning: Illegal offset type in /in/DmRZU on line 31 Warning: Illegal offset type in /in/DmRZU on line 31 Warning: Illegal offset type in /in/DmRZU on line 35 Warning: Illegal offset type in /in/DmRZU on line 36 Warning: Illegal offset type in /in/DmRZU on line 38 Warning: Illegal offset type in /in/DmRZU on line 38 Warning: Illegal offset type in /in/DmRZU on line 40 Warning: Illegal offset type in /in/DmRZU on line 41 Warning: Illegal offset type in /in/DmRZU on line 43 Warning: Illegal offset type in /in/DmRZU on line 43 Warning: Illegal offset type in /in/DmRZU on line 45 Warning: Illegal offset type in /in/DmRZU on line 46 Warning: Illegal offset type in /in/DmRZU on line 48 Warning: Illegal offset type in /in/DmRZU on line 48 Warning: Illegal offset type in /in/DmRZU on line 50 Warning: Illegal offset type in /in/DmRZU on line 51 Warning: Illegal offset type in /in/DmRZU on line 53 Warning: Illegal offset type in /in/DmRZU on line 53 Warning: Illegal offset type in /in/DmRZU on line 59 Warning: Illegal offset type in /in/DmRZU on line 60 Warning: Illegal offset type in /in/DmRZU on line 62 Warning: Illegal offset type in /in/DmRZU on line 62
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.27
Parse error: syntax error, unexpected '[', expecting ')' in /in/DmRZU on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[', expecting ')' in /in/DmRZU on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/DmRZU on line 7
Process exited with code 255.