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 hhvm-3.12.0
Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 6 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 7 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 8 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 9 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 11 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 12 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 13 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 14 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 16 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 17 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 18 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 19 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 23 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 24 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 25 Warning: Invalid operand type was used: Invalid type used as key in /in/kLPKn on line 26
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.6.28
Warning: Illegal offset type in /in/kLPKn on line 6 Warning: Illegal offset type in /in/kLPKn on line 7 Warning: Illegal offset type in /in/kLPKn on line 9 Warning: Illegal offset type in /in/kLPKn on line 9 Warning: Illegal offset type in /in/kLPKn on line 11 Warning: Illegal offset type in /in/kLPKn on line 12 Warning: Illegal offset type in /in/kLPKn on line 14 Warning: Illegal offset type in /in/kLPKn on line 14 Warning: Illegal offset type in /in/kLPKn on line 16 Warning: Illegal offset type in /in/kLPKn on line 17 Warning: Illegal offset type in /in/kLPKn on line 19 Warning: Illegal offset type in /in/kLPKn on line 19 Warning: Illegal offset type in /in/kLPKn on line 23 Warning: Illegal offset type in /in/kLPKn on line 24 Warning: Illegal offset type in /in/kLPKn on line 26 Warning: Illegal offset type in /in/kLPKn on line 26 Warning: Illegal offset type in /in/kLPKn on line 28 Warning: Illegal offset type in /in/kLPKn on line 29 Warning: Illegal offset type in /in/kLPKn on line 31 Warning: Illegal offset type in /in/kLPKn on line 31 Warning: Illegal offset type in /in/kLPKn on line 35 Warning: Illegal offset type in /in/kLPKn on line 36 Warning: Illegal offset type in /in/kLPKn on line 38 Warning: Illegal offset type in /in/kLPKn on line 38 Warning: Illegal offset type in /in/kLPKn on line 40 Warning: Illegal offset type in /in/kLPKn on line 41 Warning: Illegal offset type in /in/kLPKn on line 43 Warning: Illegal offset type in /in/kLPKn on line 43 Warning: Illegal offset type in /in/kLPKn on line 45 Warning: Illegal offset type in /in/kLPKn on line 46 Warning: Illegal offset type in /in/kLPKn on line 48 Warning: Illegal offset type in /in/kLPKn on line 48 Warning: Illegal offset type in /in/kLPKn on line 50 Warning: Illegal offset type in /in/kLPKn on line 51 Warning: Illegal offset type in /in/kLPKn on line 53 Warning: Illegal offset type in /in/kLPKn on line 53 Warning: Illegal offset type in /in/kLPKn on line 59 Warning: Illegal offset type in /in/kLPKn on line 60 Warning: Illegal offset type in /in/kLPKn on line 62 Warning: Illegal offset type in /in/kLPKn 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/kLPKn on line 5
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/kLPKn on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/kLPKn on line 5
Process exited with code 255.