3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assoc = [ 'AIG' => '88,32', 'ALLIANZ' => '86,96', 'LLOYDS' => '118,11', ]; $prepared = []; $max = 0; foreach ($assoc as $columnName => $number) { $rawLength = strlen($columnName . $number); $max = max($max, $rawLength); $prepared[htmlentities($columnName)] = [ 'asDecimal' => (float) str_replace(',', '.', $number), // declared as first element for sorting 'length' => $rawLength, 'value' => $number, ]; } asort($prepared); $min = 5; foreach ($prepared as $encodedName => $subarray) { $prepared[$encodedName]['glue'] = str_repeat('&nbsp;', $max - $subarray['length'] + $min); unset($prepared[$encodedName]['asDecimal'], $prepared[$encodedName]['length']); } // for demonstration purposes... ?> <select> <?php foreach ($prepared as $encodedName => $subarray) { echo "<option value=\"$encodedName\">$encodedName" . $subarray['glue'] . $subarray['value'] . "</option>\n"; } ?> </select>

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.70.0060.01216.58
8.3.60.0080.01118.31
8.3.50.0030.01016.66
8.3.40.0030.01018.79
8.3.30.0070.00718.67
8.3.20.0030.00524.18
8.3.10.0080.00024.66
8.3.00.0000.00826.16
8.2.190.0140.00716.58
8.2.180.0140.00425.92
8.2.170.0120.00618.70
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0040.00420.87
8.2.110.0060.00319.11
8.2.100.0040.01118.03
8.2.90.0000.00819.26
8.2.80.0080.00017.97
8.2.70.0000.00917.38
8.2.60.0070.00017.93
8.2.50.0060.00318.07
8.2.40.0030.00519.88
8.2.30.0070.00018.04
8.2.20.0000.00918.02
8.2.10.0070.00019.43
8.2.00.0000.00719.32
8.1.280.0070.00725.92
8.1.270.0000.00823.99
8.1.260.0110.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00318.99
8.1.230.0070.00417.83
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0030.00617.35
8.1.190.0040.00417.38
8.1.180.0000.00818.10
8.1.170.0030.00518.53
8.1.160.0020.00518.82
8.1.150.0000.00718.91
8.1.140.0040.00419.03
8.1.130.0020.00520.25
8.1.120.0000.00817.50
8.1.110.0090.00017.44
8.1.100.0000.00717.52
8.1.90.0040.00317.48
8.1.80.0070.00017.42
8.1.70.0030.00317.51
8.1.60.0030.00517.55
8.1.50.0070.00317.54
8.1.40.0140.00517.55
8.1.30.0120.00617.63
8.1.20.0160.00317.60
8.1.10.0160.00517.54
8.1.00.0090.00917.50
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0030.00318.46
8.0.270.0070.00018.03
8.0.260.0000.00618.64
8.0.250.0030.00317.00
8.0.240.0040.00417.02
8.0.230.0000.00717.00
8.0.220.0000.00716.96
8.0.210.0030.00316.91
8.0.200.0040.00416.88
8.0.190.0030.00616.99
8.0.180.0070.00016.92
8.0.170.0150.00316.82
8.0.160.0090.00716.93
8.0.150.0110.00516.81
8.0.140.0110.00516.75
8.0.130.0120.00415.15
8.0.120.0100.00516.90
8.0.110.0100.00616.87
8.0.100.0090.00816.84
8.0.90.0110.00416.83
8.0.80.0100.01116.86
8.0.70.0160.00316.82
8.0.60.0150.00716.82
8.0.50.0140.00816.85
8.0.30.0100.00916.86
8.0.20.0090.00916.95
8.0.10.0080.01017.00
8.0.00.0050.01016.96
7.4.330.0000.00515.55
7.4.320.0060.00016.52
7.4.300.0060.00016.63
7.4.290.0080.00316.58
7.4.280.0100.00516.59
7.4.270.0090.00616.64
7.4.260.0110.00314.97
7.4.250.0100.00516.56
7.4.240.0100.00316.58
7.4.230.0060.00516.63
7.4.220.0060.00816.62
7.4.210.0110.00616.65
7.4.200.0100.00716.55
7.4.190.0070.00716.52
7.4.180.0050.00816.59
7.4.160.0110.00716.51
7.4.150.0060.01016.51
7.4.140.0140.00216.40
7.4.130.0110.00716.42
7.4.120.0100.00816.53
7.4.110.0120.00416.38
7.4.100.0090.00816.53
7.4.90.0130.00416.38
7.4.80.0110.00816.46
7.4.70.0130.00616.44
7.4.60.0130.00716.53
7.4.50.0160.00516.39
7.4.40.0140.00316.46
7.4.30.0110.00716.53
7.4.20.0080.00616.43
7.4.10.0070.00616.42
7.4.00.0060.00916.57
7.3.330.0080.00616.18
7.3.320.0100.00314.72
7.3.310.0090.00516.38
7.3.300.0100.00416.32
7.3.290.0140.00316.27
7.3.280.0150.00216.46
7.3.270.0120.00616.37
7.3.260.0110.00516.30
7.3.250.0120.00516.39
7.3.240.0060.01116.34
7.3.230.0150.00316.27
7.3.220.0140.00316.22
7.3.210.0110.00616.18
7.3.200.0100.01016.20
7.3.190.0090.00816.25
7.3.180.0110.00616.17
7.3.170.0160.00216.21
7.3.160.0100.00816.24
7.3.150.0140.00416.25
7.3.140.0120.00516.37
7.3.130.0100.00816.25
7.3.120.0140.00316.25
7.3.110.0080.01016.20
7.3.100.0140.00316.17
7.3.90.0160.00116.53
7.3.80.0120.00516.19
7.3.70.0110.00716.41
7.3.60.0120.00516.39
7.3.50.0100.00716.49
7.3.40.0120.00516.41
7.3.30.0120.00616.49
7.3.20.0140.00417.37
7.3.10.0110.00817.26
7.3.00.0100.01017.29

preferences:
18.37 ms | 401 KiB | 5 Q