3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subscriberTags = json_decode('{"hu":2174325}', true); $availableTags = json_decode('{"cz":2174305,"hu":2174325,"at":2174333,"de":2174353,"pl":2174365,"sk":2174373,"gb":2174381,"nl":2174385,"gr":2174877,"ru":2174881}', true); $actualSubscriberTags = []; $addTags = []; $removeTags = []; foreach (['us', 'hu'] as $country) { $actualSubscriberTags[] = $country; if (!array_key_exists($country, $subscriberTags) && !in_array($country, $addTags)) { $addTags[] = $country; } } foreach (array_keys($subscriberTags) as $tag) { if (!in_array($tag, $actualSubscriberTags) && !in_array($tag, $removeTags)) { $removeTags[] = $tag; } } foreach ($addTags as $tag) { if (!array_key_exists($tag, $availableTags)) { echo 'ADD TAG ' . $tag . PHP_EOL; $availableTags[$tag] = $tag; } echo 'ADD TO USER ' . $availableTags[$tag] . PHP_EOL; } foreach ($removeTags as $tag) { echo 'REMOVE FROM USER' . $availableTags[$tag] . PHP_EOL; }

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.0100.01018.31
8.3.50.0140.00416.49
8.3.40.0110.00318.57
8.3.30.0100.01018.61
8.3.20.0000.00720.86
8.3.10.0040.00421.85
8.3.00.0050.00318.67
8.2.180.0060.01218.25
8.2.170.0120.00322.96
8.2.160.0110.00320.44
8.2.150.0000.00924.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00826.16
8.2.110.0000.00919.10
8.2.100.0030.00917.79
8.2.90.0000.00917.75
8.2.80.0000.00818.86
8.2.70.0040.00417.50
8.2.60.0040.00417.50
8.2.50.0050.00318.05
8.2.40.0060.00318.22
8.2.30.0030.00319.46
8.2.20.0070.00018.14
8.2.10.0000.00719.21
8.2.00.0000.00719.25
8.1.280.0100.00725.92
8.1.270.0060.00320.82
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00421.02
8.1.230.0070.00417.89
8.1.220.0000.00817.78
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0000.00917.62
8.1.160.0050.00218.96
8.1.150.0040.00418.88
8.1.140.0060.00318.87
8.1.130.0000.00720.29
8.1.120.0000.00717.43
8.1.110.0000.00717.49
8.1.100.0000.00817.32
8.1.90.0030.00317.47
8.1.80.0080.00017.38
8.1.70.0040.00417.49
8.1.60.0040.00417.50
8.1.50.0060.00317.59
8.1.40.0080.00417.54
8.1.30.0040.00417.71
8.1.20.0000.00817.64
8.1.10.0000.00817.49
8.1.00.0030.00617.53
8.0.300.0050.00318.85
8.0.290.0060.00316.75
8.0.280.0040.00418.58
8.0.270.0040.00417.90
8.0.260.0030.00320.08
8.0.250.0030.00316.89
8.0.240.0000.00616.97
8.0.230.0070.00016.93
8.0.220.0070.00016.91
8.0.210.0080.00016.98
8.0.200.0060.00017.02
8.0.190.0040.00416.86
8.0.180.0000.00816.95
8.0.170.0000.00816.84
8.0.160.0000.00716.98
8.0.150.0000.00716.96
8.0.140.0070.00316.87
8.0.130.0030.00313.38
8.0.120.0030.00616.88
8.0.110.0070.00016.86
8.0.100.0040.00416.79
8.0.90.0000.00816.92
8.0.80.0080.01016.85
8.0.70.0000.00716.93
8.0.60.0050.00216.98
8.0.50.0000.00716.86
8.0.30.0060.01217.09
8.0.20.0090.00917.09
8.0.10.0000.00816.82
8.0.00.0100.00716.80
7.4.330.0060.00016.60
7.4.320.0030.00316.55
7.4.300.0040.00416.52
7.4.290.0050.00316.57
7.4.280.0040.00416.53
7.4.270.0070.00416.45
7.4.260.0030.00313.33
7.4.250.0030.00316.59
7.4.240.0040.00316.64
7.4.230.0000.00716.37
7.4.220.0000.00716.41
7.4.210.0050.01016.61
7.4.200.0000.00716.61
7.4.130.0130.00516.51
7.4.120.0140.00616.51
7.4.110.0030.01616.60
7.4.100.0180.00316.58
7.4.90.0120.00416.55
7.4.80.0160.01219.39
7.4.70.0120.00916.44
7.4.60.0120.00716.34
7.4.50.0030.01316.42
7.4.40.0030.01516.50
7.4.20.0110.01116.49
7.4.10.0040.01616.56
7.4.00.0110.00616.36
7.3.330.0000.00716.21
7.3.320.0050.00013.36
7.3.310.0000.00716.20
7.3.300.0000.00716.38
7.3.290.0050.01016.35
7.3.260.0120.00616.35
7.3.240.0090.00916.53
7.3.230.0120.00616.65
7.3.210.0060.01316.57
7.3.200.0130.00416.27
7.3.190.0100.00716.29
7.3.180.0100.00716.36
7.3.170.0110.00416.35
7.3.160.0060.00916.39
7.3.140.0060.01516.18
7.3.130.0090.00616.27
7.3.120.0130.00716.11
7.3.110.0130.00716.43
7.3.100.0100.00716.20
7.3.90.0070.01016.48
7.3.80.0100.00716.40
7.3.70.0100.00916.21
7.3.60.0160.00616.36
7.3.50.0030.01616.44
7.3.40.0070.01116.29
7.3.30.0180.00316.32
7.3.20.0090.00916.16
7.3.10.0090.00616.51
7.3.00.0100.01016.47
7.2.330.0130.00916.60
7.2.320.0140.00316.77
7.2.310.0070.01016.51
7.2.300.0060.01216.65
7.2.290.0070.01016.51
7.2.270.0100.01016.57
7.2.260.0150.00616.58
7.2.250.0060.01516.45
7.2.240.0040.01816.64
7.2.230.0090.00816.50
7.2.220.0060.01216.43
7.2.210.0060.01616.57
7.2.200.0170.00716.52
7.2.190.0090.00916.58
7.2.180.0080.01216.59
7.2.170.0140.00716.43
7.2.160.0070.01116.49
7.2.150.0150.00916.52
7.2.140.0060.01116.56
7.2.130.0070.01116.34
7.2.120.0060.01216.39
7.2.110.0040.01416.56
7.2.100.0160.01016.62
7.2.90.0100.00716.58
7.2.80.0000.01816.63
7.2.70.0090.00916.43
7.2.60.0060.01216.52
7.2.50.0070.01616.70
7.2.40.0060.01516.30
7.2.30.0140.01416.67
7.2.20.0110.01216.54
7.2.10.0120.00616.34
7.2.00.0090.01216.52

preferences:
63.16 ms | 400 KiB | 5 Q