3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getValues(&$egElement, $property, $option = NULL) { if(is_array($egElement) === FALSE) { return array(); } if(is_int($option) and $option > 1) { $values = array(); foreach($egElement as $key => $egSubElement) { $values = array_merge( $values, getValues($egSubElement, $property, $option - 1) ); } return $values; } if( is_string($option) or $option === TRUE ) { $values = array(); foreach($egElement as $key => $eElement) { if(array_key_exists($property, $eElement)) { if(is_string($option)) { $values[$key] = call_user_func_array($option, array($eElement[$property])); } else if($option === TRUE) { $values[$key] = &$egElement[$key][$property]; } } } reset($egElement); } else { return array_column($egElement, $property); } return $values; } getValues(array( 1 => array('id' => 4, 'dragon' => array('toto' => 5, 'titi' => 6)), 2 => array('id' => 5, 'dragon' => array('toto' => 5, 'titi' => 6)), 3 => array('id' => 6, 'dragon' => array('toto' => 5, 'titi' => 6)), 4 => array('id' => 7, 'dragon' => array('toto' => 5, 'titi' => 6)), 5 => array('id' => 8, 'dragon' => array('toto' => 5, 'titi' => 6)), 6 => array('id' => 9, 'dragon' => array('toto' => 5, 'titi' => 6)), 7 => array('id' => 10, 'dragon' => array('toto' => 5, 'titi' => 6)), 8 => array('id' => 11, 'dragon' => array('toto' => 5, 'titi' => 6)), ));

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0120.00818.43
8.3.50.0070.00717.82
8.3.40.0120.00318.68
8.3.30.0120.00319.02
8.3.20.0050.00220.29
8.3.10.0040.00421.95
8.3.00.0040.00422.34
8.2.180.0140.00716.63
8.2.170.0090.00622.96
8.2.160.0060.00820.58
8.2.150.0060.00324.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0080.00019.38
8.2.110.0030.00620.44
8.2.100.0030.00620.47
8.1.270.0080.00022.13
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00320.38
8.1.230.0090.00018.48
5.4.270.0100.06018.81
5.4.260.0170.05718.91
5.4.250.0130.04718.75
5.4.240.0170.07018.77
5.4.230.0130.07318.97
5.4.220.0030.07318.65
5.4.210.0100.06019.03
5.4.200.0030.07018.99
5.4.190.0070.05318.96
5.4.180.0230.06019.09
5.4.170.0100.06719.00
5.4.160.0200.04718.82
5.4.150.0070.07718.97
5.4.140.0070.08016.49
5.4.130.0200.05016.45
5.4.120.0130.07016.62
5.4.110.0230.05316.50
5.4.100.0070.07016.54
5.4.90.0070.06316.55
5.4.80.0170.07316.33
5.4.70.0130.05316.64
5.4.60.0200.07016.36
5.4.50.0070.04716.37
5.4.40.0100.06716.51
5.4.30.0030.05716.48
5.4.20.0100.05716.51
5.4.10.0130.06016.46
5.4.00.0200.05715.93
5.3.280.0170.04714.80
5.3.270.0130.06714.66
5.3.260.0030.07314.76
5.3.250.0170.05014.69
5.3.240.0230.05714.61
5.3.230.0100.06014.80
5.3.220.0100.06714.80
5.3.210.0070.06014.41
5.3.200.0130.05714.49
5.3.190.0000.06314.76
5.3.180.0030.06014.57
5.3.170.0130.05314.57
5.3.160.0000.06714.66
5.3.150.0070.07014.57
5.3.140.0170.07014.40
5.3.130.0030.06714.74
5.3.120.0170.05014.65
5.3.110.0230.04314.65
5.3.100.0130.06314.06
5.3.90.0000.05714.12
5.3.80.0100.07314.05
5.3.70.0100.05314.02
5.3.60.0100.05714.20
5.3.50.0130.04314.00
5.3.40.0100.05713.80
5.3.30.0200.04014.14
5.3.20.0100.05313.73
5.3.10.0170.05313.57
5.3.00.0230.06013.72
5.2.170.0100.05711.34
5.2.160.0070.04711.25
5.2.150.0230.04011.38
5.2.140.0070.04711.13
5.2.130.0070.04011.09
5.2.120.0070.04011.19
5.2.110.0030.04311.08
5.2.100.0130.03711.19
5.2.90.0130.05011.21
5.2.80.0100.05011.18
5.2.70.0070.04311.06
5.2.60.0100.03711.16
5.2.50.0000.05011.13
5.2.40.0030.05311.09
5.2.30.0130.03710.82
5.2.20.0100.04311.16
5.2.10.0070.03710.96
5.2.00.0130.03710.82
5.1.60.0070.04310.09
5.1.50.0070.04310.21
5.1.40.0030.0379.99
5.1.30.0070.05010.43
5.1.20.0070.04010.46
5.1.10.0070.04710.09
5.1.00.0030.04310.18
5.0.50.0070.0308.53
5.0.40.0130.0308.58
5.0.30.0070.0408.34
5.0.20.0100.0208.13
5.0.10.0070.0378.20
5.0.00.0070.0378.17
4.4.90.0030.0236.74
4.4.80.0070.0236.74
4.4.70.0030.0306.74
4.4.60.0000.0236.74
4.4.50.0000.0276.74
4.4.40.0070.0476.74
4.4.30.0030.0206.74
4.4.20.0030.0206.74
4.4.10.0070.0176.74
4.4.00.0000.0476.74
4.3.110.0100.0236.74
4.3.100.0030.0206.74
4.3.90.0030.0206.74
4.3.80.0030.0436.74
4.3.70.0130.0206.74
4.3.60.0070.0236.74
4.3.50.0000.0306.74
4.3.40.0000.0476.74
4.3.30.0000.0276.74
4.3.20.0030.0206.74
4.3.10.0000.0336.74
4.3.00.0000.0277.02

preferences:
43.62 ms | 400 KiB | 5 Q