3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 'foo', 'foo', 'bar', 'baz', 'baz' ]; array_walk($arr, function (&$item, $k) use ($arr) { $lower = mb_strtolower($item, 'utf-8'); foreach ($arr as $i => $v) { if ($i !== $k && $lower === mb_strtolower($v, 'utf-8')) { $item = null; } } }); var_dump($arr);

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.63
8.3.50.0140.00716.35
8.3.40.0090.01318.75
8.3.30.0090.00618.51
8.3.20.0070.00020.20
8.3.10.0040.00421.73
8.3.00.0080.00019.68
8.2.180.0060.00918.41
8.2.170.0070.00722.96
8.2.160.0130.00318.91
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00019.45
8.2.120.0050.00326.35
8.2.110.0100.00022.08
8.2.100.0110.00017.72
8.2.90.0060.00317.91
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0000.00818.04
8.2.50.0060.00318.10
8.2.40.0040.00420.42
8.2.30.0000.00719.38
8.2.20.0000.00718.15
8.2.10.0000.00818.13
8.2.00.0070.00018.09
8.1.280.0160.00025.92
8.1.270.0050.00321.88
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00022.16
8.1.230.0000.01120.88
8.1.220.0040.00417.91
8.1.210.0080.00018.77
8.1.200.0030.00617.36
8.1.190.0030.00617.35
8.1.180.0080.00018.10
8.1.170.0070.00318.71
8.1.160.0040.00418.98
8.1.150.0000.00718.97
8.1.140.0080.00019.55
8.1.130.0040.00418.99
8.1.120.0000.00817.56
8.1.110.0040.00417.52
8.1.100.0050.00517.46
8.1.90.0060.00317.50
8.1.80.0000.00717.58
8.1.70.0030.00317.57
8.1.60.0000.00817.58
8.1.50.0000.00817.57
8.1.40.0040.00417.57
8.1.30.0040.00417.74
8.1.20.0000.00717.76
8.1.10.0020.00517.61
8.1.00.0000.00817.53
8.0.300.0000.00720.16
8.0.290.0040.00416.75
8.0.280.0030.00318.41
8.0.270.0030.00317.32
8.0.260.0030.00316.94
8.0.250.0000.00617.07
8.0.240.0070.00316.95
8.0.230.0000.00717.03
8.0.220.0030.00317.02
8.0.210.0040.00416.85
8.0.200.0000.00717.00
8.0.190.0040.00816.87
8.0.180.0040.00417.02
8.0.170.0070.00016.94
8.0.160.0030.00516.86
8.0.150.0070.00016.91
8.0.140.0030.00616.91
8.0.130.0050.00013.35
8.0.120.0040.00416.90
8.0.110.0040.00416.95
8.0.100.0070.00016.95
8.0.90.0000.00716.98
8.0.80.0130.00316.95
8.0.70.0000.00716.99
8.0.60.0040.00416.86
8.0.50.0040.00416.83
8.0.30.0090.00917.17
8.0.20.0080.01217.40
8.0.10.0080.00017.11
8.0.00.0030.01316.61
7.4.330.0050.00015.55
7.4.320.0030.00316.59
7.4.300.0030.00316.58
7.4.290.0070.00016.68
7.4.280.0040.00416.50
7.4.270.0030.00316.59
7.4.260.0070.00016.64
7.4.250.0030.00316.59
7.4.240.0000.00716.70
7.4.230.0000.00816.47
7.4.220.0140.00316.61
7.4.210.0070.01016.56
7.4.200.0030.00316.32
7.4.160.0150.00116.48
7.4.150.0140.00417.40
7.4.140.0090.00917.86
7.4.130.0040.01516.39
7.4.120.0060.01616.54
7.4.110.0060.01116.63
7.4.100.0080.01116.43
7.4.90.0110.00616.63
7.4.80.0100.01319.39
7.4.70.0060.01016.53
7.4.60.0030.01516.66
7.4.50.0040.00716.29
7.4.40.0080.00816.48
7.4.30.0060.01216.62
7.4.00.0090.00614.82
7.3.330.0020.00213.38
7.3.320.0050.00013.39
7.3.310.0030.00316.46
7.3.300.0030.00316.30
7.3.290.0040.00416.45
7.3.280.0060.01116.43
7.3.270.0120.00617.40
7.3.260.0100.01016.39
7.3.250.0110.01116.56
7.3.240.0070.01216.46
7.3.230.0140.00316.65
7.3.210.0070.01016.53
7.3.200.0070.01016.64
7.3.190.0110.00816.64
7.3.180.0120.00916.55
7.3.170.0060.01116.38
7.3.160.0070.01016.63
7.2.330.0060.01216.74
7.2.320.0170.00016.88
7.2.310.0100.00616.78
7.2.300.0070.01016.66
7.2.290.0090.00916.50
7.2.60.1250.01115.20
7.2.00.0030.01019.56
7.1.200.0000.00715.79
7.1.100.0030.01418.39
7.1.70.0100.00715.61
7.1.60.0380.01933.60
7.1.50.0240.02433.03
7.1.40.0350.01032.63
7.1.30.1210.01632.74
7.1.20.0640.00932.82
7.1.10.0180.00914.87
7.1.00.0200.00814.69
7.0.200.0310.00715.05
7.0.190.0290.00414.84
7.0.180.0300.00614.44
7.0.170.0270.00814.30
7.0.160.0200.01314.32
7.0.150.0200.00714.55
7.0.140.0260.01014.54
7.0.130.0200.01114.63
7.0.120.0140.01114.63
7.0.110.0190.00814.40
7.0.100.0230.00414.61
7.0.90.0110.01414.52
7.0.80.0190.00614.50
7.0.70.0150.01214.46
7.0.60.0180.00914.38
7.0.50.0200.00714.65
7.0.40.0160.01314.79
7.0.30.0220.00614.68
7.0.20.0150.01114.64
7.0.10.0150.01214.71
7.0.00.0180.00914.78

preferences:
61.6 ms | 400 KiB | 5 Q