3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ratingHistory = [ "BB", "B", "CCC", "C", "BB" ]; function getMinMax($array): array { $result = ['min' => null, 'max' => null]; foreach ($array as $value) { if ( !$result['min'] || (!trim($value, $result['min']) ? $value < $result['min'] : $value > $result['min']) ) { $result['min'] = $value; } if ( !$result['max'] || (!trim($value, $result['max']) ? $value > $result['max'] : $value < $result['max']) ) { $result['max'] = $value; } } return $result; } var_export(getMinMax($ratingHistory));

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.0090.00616.32
8.3.50.0070.00720.03
8.3.40.0110.00321.86
8.3.30.0100.00618.68
8.3.20.0080.00024.18
8.3.10.0050.00224.66
8.3.00.0040.00426.16
8.2.180.0080.00825.92
8.2.170.0100.00618.97
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00818.77
8.2.110.0030.00621.99
8.2.100.0060.00617.72
8.2.90.0060.00317.88
8.2.80.0040.00418.91
8.2.70.0030.00517.63
8.2.60.0000.00818.05
8.2.50.0050.00318.07
8.2.40.0000.00820.07
8.2.30.0040.00418.13
8.2.20.0050.00320.44
8.2.10.0070.00018.00
8.2.00.0000.00819.19
8.1.280.0150.00025.92
8.1.270.0030.00623.99
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00320.41
8.1.230.0060.00617.82
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0050.00517.35
8.1.190.0050.00317.35
8.1.180.0070.00418.10
8.1.170.0040.00418.45
8.1.160.0080.00318.93
8.1.150.0060.00318.58
8.1.140.0000.00717.45
8.1.130.0040.00419.26
8.1.120.0060.00317.46
8.1.110.0000.00817.45
8.1.100.0000.00717.48
8.1.90.0030.00517.48
8.1.80.0070.00417.36
8.1.70.0000.01117.26
8.1.60.0070.00717.45
8.1.50.0130.00017.34
8.1.40.0060.00317.38
8.1.30.0060.00317.63
8.1.20.0070.00417.56
8.1.10.0090.00917.50
8.1.00.0180.00017.42
8.0.300.0000.00818.77
8.0.290.0000.00816.75
8.0.280.0050.00320.15
8.0.270.0040.00417.91
8.0.260.0030.00318.67
8.0.250.0040.00416.83
8.0.240.0070.00017.00
8.0.230.0070.00016.95
8.0.220.0070.00016.77
8.0.210.0030.00716.78
8.0.200.0140.00016.91
8.0.190.0100.00516.83
8.0.180.0150.00016.75
8.0.170.0090.00616.88
8.0.160.0070.00716.79
8.0.150.0110.00416.74
8.0.140.0070.00716.82
8.0.130.0070.00716.75
8.0.120.0090.00616.72
8.0.110.0090.00416.70
8.0.100.0100.00516.74
8.0.90.0050.01016.85
8.0.80.0110.00316.72
8.0.70.0100.00516.83
8.0.60.0110.00316.74
8.0.50.0140.00016.72
8.0.30.0090.00616.77
8.0.20.0100.00516.80
8.0.10.0070.00716.82
7.4.330.0000.00415.55
7.4.320.0000.00616.60
7.4.300.0030.00616.43
7.4.290.0060.00316.43
7.4.280.0030.00316.50
7.4.270.0110.00416.48
7.4.260.0130.00316.43
7.4.250.0130.00016.56
7.4.240.0000.01616.47
7.4.230.0160.00016.34
7.4.220.0150.00016.45
7.4.210.0120.00216.47
7.4.200.0090.00416.52
7.4.190.0120.00416.50
7.4.180.0090.00616.51
7.4.160.0110.00416.63
7.4.150.0120.00216.45
7.4.140.0090.00616.43
7.4.130.0150.00016.39
7.4.120.0070.00716.31
7.4.110.0070.00716.43
7.4.100.0080.00416.48
7.4.90.0000.01116.48
7.4.80.0100.00316.48
7.4.70.0070.00416.54
7.4.60.0080.00416.54
7.4.50.0100.00016.40
7.4.40.0060.00316.47
7.4.30.0070.00316.39
7.4.20.0020.00616.33
7.4.10.0110.00016.36
7.4.00.0050.00516.50

preferences:
62.81 ms | 400 KiB | 5 Q