3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = array("foo-1" => array(array("A", 3), array("B", 3)), "foo-2" => array(array("A", 1), array("B", 7)), "foo-3" => array(array("A", 1), array("B", 6))); $names = "("; $letters = "("; $numbers = ""; $coordinate = ""; foreach($arrays as $arrayName => $array) { if(array_search($arrayName, array_keys($arrays)) == 0) { $names .= $arrayName; }else{ $names .= ",".$arrayName; } foreach($array as $key => $nestedArray) { foreach($nestedArray as $letterOrNum => $value) { if($letterOrNum == 0) { // it's a letter if($key + 1 == 1) { $nextLetter = $array[$key + 1][0]; if (!strpos($letters, $value.','.$nextLetter) !== false) { if($key == 0 && array_search($arrayName, array_keys($arrays)) == 0) { $letters .= $value; }else{ $letters .= ",".$value; } } }else{ $previousLetter = $array[$key - 1][0]; if (!strpos($letters, $previousLetter.','.$value) !== false) { if($key == 0 && array_search($arrayName, array_keys($arrays)) == 0) { $letters .= $value; }else{ $letters .= ",".$value; } } } }else{ // its a number if($key == 0) { $coordinate .= "(".$value.","; }else{ $coordinate .= $value.")"; } $numbers .= $coordinate; $coordinate = ""; } } } } $names .= ")"; $letters .= ")"; echo $names; echo $letters; echo $numbers;

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.4.140.0080.01417.58
8.4.130.0060.00218.88
8.4.120.0140.00724.14
8.4.110.0110.00624.11
8.4.100.0120.00917.61
8.4.90.0160.00520.50
8.4.80.0120.00717.93
8.4.70.0120.00817.76
8.4.60.0120.00818.60
8.4.50.0150.00518.75
8.4.40.0130.00618.75
8.4.30.0070.01118.66
8.4.20.0140.00720.67
8.4.10.0030.00619.77
8.3.270.0120.00716.63
8.3.260.0040.00516.57
8.3.250.0050.01316.98
8.3.240.0090.00717.39
8.3.230.0050.00416.59
8.3.220.0100.00718.98
8.3.210.0110.00816.73
8.3.200.0060.00616.44
8.3.190.0130.00816.56
8.3.180.0150.00316.73
8.3.170.0060.01318.84
8.3.160.0070.01116.55
8.3.150.0120.00616.60
8.3.140.0030.00617.35
8.3.130.0000.00918.39
8.3.120.0100.00618.78
8.3.110.0040.01120.94
8.3.100.0110.01124.06
8.3.90.0030.00626.77
8.3.80.0040.00416.50
8.3.70.0040.01116.75
8.3.60.0140.00418.43
8.3.50.0070.01324.43
8.3.40.0110.00320.26
8.3.30.0070.00718.85
8.3.20.0000.00821.81
8.3.10.0040.00422.09
8.3.00.0040.00420.65
8.2.290.0130.00616.48
8.2.280.0090.00720.02
8.2.270.0110.00718.89
8.2.260.0080.00018.54
8.2.250.0120.00317.02
8.2.240.0130.00716.96
8.2.230.0030.00622.58
8.2.220.0030.00537.54
8.2.210.0070.00026.77
8.2.200.0030.00616.50
8.2.190.0210.00018.18
8.2.180.0150.00416.38
8.2.170.0130.01022.96
8.2.160.0090.00619.22
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00026.16
8.2.110.0070.00421.04
8.2.100.0080.00417.84
8.2.90.0000.00818.34
8.2.80.0040.00418.96
8.2.70.0040.00417.63
8.2.60.0030.00517.63
8.2.50.0030.00619.32
8.2.40.0050.00321.19
8.2.30.0080.00019.21
8.2.20.0000.00718.11
8.2.10.0040.00419.23
8.2.00.0040.00419.32
8.1.330.0130.00618.37
8.1.320.0160.00416.26
8.1.310.0070.00018.45
8.1.300.0050.00318.12
8.1.290.0040.00418.88
8.1.280.0030.01025.92
8.1.270.0060.00322.05
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0040.01122.08
8.1.230.0120.00022.81
8.1.220.0090.00017.79
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0040.00417.23
8.1.180.0000.00819.03
8.1.170.0000.00818.70
8.1.160.0000.00918.95
8.1.150.0000.00718.86
8.1.140.0000.00718.82
8.1.130.0000.00720.20
8.1.120.0030.00617.34
8.1.110.0000.00717.41
8.1.100.0040.00417.38
8.1.90.0000.00817.45
8.1.80.0000.00717.40
8.1.70.0000.01017.33
8.1.60.0030.00517.54
8.1.50.0030.00517.37
8.1.40.0040.00417.56
8.1.30.0000.00817.61
8.1.20.0040.00417.64
8.1.10.0030.00517.61
8.1.00.0030.00517.46
8.0.300.0040.00420.02
8.0.290.0000.00816.63
8.0.280.0000.00718.51
8.0.270.0070.00016.80
8.0.260.0070.00021.87
8.0.250.0070.00016.89
8.0.240.0030.00617.02
8.0.230.0030.00316.92
8.0.220.0060.00316.90
8.0.210.0070.00016.94
8.0.200.0070.00016.93
8.0.190.0080.00016.86
8.0.180.0000.00716.84
8.0.170.0050.00316.80
8.0.160.0000.00816.82
8.0.150.0000.00716.77
8.0.140.0000.00816.79
8.0.130.0030.00313.38
8.0.120.0040.00416.79
8.0.110.0000.00816.84
8.0.100.0040.00416.78
8.0.90.0040.00416.72
8.0.80.0100.00816.77
8.0.70.0030.00516.84
8.0.60.0040.00416.74
8.0.50.0000.00716.97
8.0.30.0160.00016.82
8.0.20.0090.00917.01
8.0.10.0000.00717.08
8.0.00.0060.01216.82
7.4.330.0000.00415.55
7.4.320.0030.00316.55
7.4.300.0000.00616.66
7.4.290.0030.00316.42
7.4.280.0030.00516.51
7.4.270.0030.00316.47
7.4.260.0030.00313.28
7.4.250.0000.00716.48
7.4.240.0000.00716.55
7.4.230.0030.00316.40
7.4.220.0030.00316.52
7.4.210.0060.01016.52
7.4.200.0000.00816.50
7.4.130.0080.01016.45
7.4.120.0130.01016.44
7.4.110.0030.01416.49
7.4.100.0070.01016.41
7.4.90.0060.01216.55
7.4.80.0070.01419.39
7.4.70.0100.00616.45
7.4.60.0050.01116.59
7.4.50.0080.00516.27
7.4.40.0110.00716.50
7.4.30.0120.00316.16
7.4.20.0100.00716.42
7.4.10.0220.00316.37
7.4.00.0070.01016.34
7.3.330.0040.00416.15
7.3.320.0000.00713.15
7.3.310.0070.00016.38
7.3.300.0030.00316.31
7.3.290.0030.01316.33
7.3.280.0040.01116.37
7.3.260.0180.00616.38
7.3.240.0070.01016.37
7.3.230.0070.01316.27
7.3.210.0070.01016.40
7.3.200.0130.00316.56
7.3.190.0110.00516.64
7.3.180.0050.01616.59
7.3.170.0140.00616.55
7.3.160.0070.01016.51
7.3.150.0060.00916.23
7.3.140.0090.01416.55
7.3.130.0090.00916.26
7.3.120.0040.01316.64
7.3.110.0060.01516.49
7.3.100.0140.00316.57
7.3.90.0140.00416.38
7.3.80.0070.01316.23
7.3.70.0110.01016.46
7.3.60.0080.00916.32
7.3.50.0140.00316.13
7.3.40.0120.00516.17
7.3.30.0110.00616.54
7.3.20.0130.00616.53
7.3.10.0150.00916.26
7.3.00.0000.01816.20
7.2.330.0040.01516.72
7.2.320.0130.00416.89
7.2.310.0060.01016.82
7.2.300.0060.01516.55
7.2.290.0090.00916.68
7.2.280.0040.01316.80
7.2.270.0100.00816.61
7.2.260.0150.00816.82
7.2.250.0120.01016.48
7.2.240.0090.01216.72
7.2.230.0140.00316.53
7.2.220.0110.00716.80
7.2.210.0060.01616.52
7.2.200.0090.00716.52
7.2.190.0040.01316.51
7.2.180.0030.01316.60
7.2.170.0060.01316.65
7.2.160.0050.01616.38
7.2.150.0160.00516.70
7.2.140.0030.01516.57
7.2.130.0090.00916.58
7.2.120.0110.00816.62
7.2.110.0130.00716.71
7.2.100.0190.00316.70
7.2.90.0560.01016.67
7.2.80.0110.00816.70
7.2.70.0080.01116.68
7.2.60.0060.01316.53
7.2.50.0060.01616.64
7.2.40.0240.00016.59
7.2.30.0150.00916.54
7.2.20.0130.00916.52
7.2.10.0090.01316.78
7.2.00.0120.00816.72

preferences:
32.67 ms | 403 KiB | 5 Q