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 && $v !== null && $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.0120.00316.75
8.3.50.0120.00316.47
8.3.40.0040.01418.71
8.3.30.0150.00018.58
8.3.20.0040.00421.96
8.3.10.0040.00421.95
8.3.00.0030.00519.56
8.2.180.0110.00416.63
8.2.170.0120.00322.96
8.2.160.0100.00718.75
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0060.00319.21
8.2.120.0060.00326.35
8.2.110.0060.00320.38
8.2.100.0030.00917.61
8.2.90.0000.00819.24
8.2.80.0030.00518.05
8.2.70.0090.00317.60
8.2.60.0000.00817.80
8.2.50.0000.00818.10
8.2.40.0000.00820.59
8.2.30.0000.00719.25
8.2.20.0000.00718.17
8.2.10.0040.00418.04
8.2.00.0040.00418.23
8.1.280.0070.00725.92
8.1.270.0070.00022.06
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0090.00022.81
8.1.230.0030.00820.93
8.1.220.0040.00417.76
8.1.210.0000.00818.77
8.1.200.0090.00017.35
8.1.190.0050.00317.35
8.1.180.0070.00018.10
8.1.170.0030.00618.71
8.1.160.0070.00018.97
8.1.150.0000.00818.88
8.1.140.0040.00419.63
8.1.130.0000.00719.01
8.1.120.0000.00717.45
8.1.110.0060.00317.47
8.1.100.0030.00517.40
8.1.90.0040.00417.52
8.1.80.0000.00717.56
8.1.70.0030.00317.39
8.1.60.0040.00417.69
8.1.50.0030.00517.50
8.1.40.0030.00717.55
8.1.30.0000.00817.80
8.1.20.0000.00717.71
8.1.10.0040.00417.55
8.1.00.0040.00417.48
8.0.300.0000.00918.77
8.0.290.0000.00716.75
8.0.280.0020.00518.39
8.0.270.0030.00317.28
8.0.260.0030.00516.89
8.0.250.0030.00317.00
8.0.240.0050.00516.89
8.0.230.0040.00416.93
8.0.220.0000.00716.83
8.0.210.0040.00416.86
8.0.200.0030.00317.04
8.0.190.0030.00917.05
8.0.180.0000.00716.91
8.0.170.0040.00417.02
8.0.160.0000.00716.96
8.0.150.0040.00416.92
8.0.140.0030.00416.93
8.0.130.0000.00913.35
8.0.120.0050.00216.84
8.0.110.0070.00016.74
8.0.100.0000.00716.96
8.0.90.0070.00016.83
8.0.80.0130.00616.93
8.0.70.0040.00417.03
8.0.60.0040.00417.08
8.0.50.0070.00016.76
8.0.30.0120.00817.10
8.0.20.0070.01117.40
8.0.10.0040.00416.99
8.0.00.0090.00916.75
7.4.330.0050.00015.55
7.4.320.0000.00616.67
7.4.300.0040.00416.49
7.4.290.0000.00616.72
7.4.280.0080.00016.55
7.4.270.0080.00016.65
7.4.260.0030.00616.58
7.4.250.0070.00016.40
7.4.240.0000.00716.52
7.4.230.0000.00716.38
7.4.220.0030.01416.56
7.4.210.0110.00616.55
7.4.200.0030.00316.73
7.4.160.0110.00516.64
7.4.150.0200.00317.40
7.4.140.0090.00917.86
7.4.130.0120.00616.40
7.4.120.0080.01216.53
7.4.110.0160.00016.41
7.4.100.0140.00416.50
7.4.90.0030.01316.55
7.4.80.0100.00719.39
7.4.70.0100.01016.69
7.4.60.0030.01316.43
7.4.50.0030.01316.62
7.4.40.0120.00416.54
7.4.30.0030.01216.59
7.4.00.0000.01714.85
7.3.330.0050.00013.39
7.3.320.0030.00313.43
7.3.310.0030.00316.47
7.3.300.0040.00416.42
7.3.290.0060.00316.43
7.3.280.0090.00916.43
7.3.270.0120.00617.40
7.3.260.0140.00716.46
7.3.250.0080.01216.51
7.3.240.0120.00716.45
7.3.230.0100.01316.68
7.3.210.0030.01316.44
7.3.200.0120.00916.54
7.3.190.0130.00316.52
7.3.180.0140.00516.50
7.3.170.0060.01116.32
7.3.160.0130.00316.54
7.3.120.0000.01715.04
7.3.110.0080.00615.07
7.3.100.0060.00914.77
7.3.90.0060.00614.50
7.3.80.0000.01714.99
7.3.70.0030.01214.82
7.3.60.0030.01314.89
7.3.50.0000.01414.80
7.3.40.0070.01014.61
7.3.30.0060.00614.61
7.3.20.0110.00416.68
7.3.10.0070.00716.63
7.3.00.0070.00916.68
7.2.330.0080.00916.71
7.2.320.0100.01016.76
7.2.310.0090.00616.58
7.2.300.0150.00316.58
7.2.290.0080.00816.73
7.2.240.0110.00415.24
7.2.230.0100.00015.00
7.2.220.0040.01415.35
7.2.210.0060.00915.07
7.2.200.0040.00715.18
7.2.190.0030.01215.18
7.2.180.0040.01115.07
7.2.170.0030.01015.20
7.2.160.0100.00315.20
7.2.150.0000.01617.10
7.2.140.0040.00817.10
7.2.130.0030.01017.01
7.2.120.0090.00617.03
7.2.110.0020.00716.91
7.2.100.0060.01016.79
7.2.90.0050.00916.72
7.2.80.0030.01016.99
7.2.70.0060.00817.08
7.2.60.0450.00916.47
7.2.50.0010.01016.85
7.2.40.0060.01116.88
7.2.30.0050.01017.01
7.2.20.0050.00717.03
7.2.10.0060.00817.04
7.2.00.0060.00717.70
7.1.330.0090.00615.77
7.1.320.0030.01515.88
7.1.310.0060.00315.99
7.1.300.0000.01115.93
7.1.290.0040.01116.03
7.1.280.0070.01015.96
7.1.270.0060.00315.75
7.1.260.0030.00915.87
7.1.250.0070.00915.93
7.1.200.0080.00315.86
7.1.100.0100.00318.05
7.1.70.0290.01015.51
7.1.60.0350.01133.38
7.1.50.0400.02433.18
7.1.40.0450.02032.74
7.1.30.0590.00932.71
7.1.20.0390.02232.98
7.1.10.0300.01114.91
7.1.00.0200.01514.88
7.0.200.1340.01714.72
7.0.190.0640.01314.60
7.0.180.0320.01014.39
7.0.170.0220.01614.53
7.0.160.0130.01614.59
7.0.150.0290.00914.32
7.0.140.0270.00814.40
7.0.130.0180.01214.55
7.0.120.0280.01014.82
7.0.110.0240.01414.55
7.0.100.0260.01014.39
7.0.90.0460.01014.36
7.0.80.0320.01014.53
7.0.70.0300.00914.53
7.0.60.0320.01014.39
7.0.50.0270.01314.38
7.0.40.0250.01214.79
7.0.30.0220.01314.80
7.0.20.0230.01314.64
7.0.10.0250.00714.70
7.0.00.0250.01614.68

preferences:
35.09 ms | 401 KiB | 5 Q