3v4l.org

run code in 300+ PHP versions simultaneously
<?php function AlphabetSoup($data,$currentValues) { $result =[]; // foreach ($currentValues as $key => $value){ // if($data[$key] == $value) continue; // $result[$key] = $value; if($data['allocation_even'] ==! $currentValues['allocation_even']) { $result['allocation_even'] = $data['allocation_even']; } $differences = array_merge(array_diff(explode(',', $data['os_targeting']), explode(',' , $currentValues['os_targeting'])) , array_diff(explode(',', $currentValues['os_targeting']), explode(',' ,$data['os_targeting']))); if(!empty($differences)) { $result['os_targeting'] = $data['os_targeting']; } return $result; } $data = [ 'allocation_even' => '1' , 'os_targeting' => 'Mac_OS_X,Linux,Win']; $current = [ 'allocation_even' => '1' , 'os_targeting' => 'Win,Mac_OS_X,Linux', 'other_value'=>0]; print_r( AlphabetSoup($data,$current));

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.00318.31
8.3.50.0040.01118.14
8.3.40.0090.00618.71
8.3.30.0040.01518.79
8.3.20.0050.00319.21
8.3.10.0000.00723.56
8.3.00.0000.00720.64
8.2.180.0070.01018.41
8.2.170.0120.00322.96
8.2.160.0070.00720.95
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00019.82
8.2.120.0040.00426.35
8.2.110.0060.00319.41
8.2.100.0080.00419.57
8.2.90.0030.00517.75
8.2.80.0060.00317.97
8.2.70.0000.00817.93
8.2.60.0040.00418.28
8.2.50.0080.00018.10
8.2.40.0080.00019.47
8.2.30.0080.00019.31
8.2.20.0000.00718.02
8.2.10.0040.00418.11
8.2.00.0030.00717.78
8.1.280.0070.01025.92
8.1.270.0080.00018.87
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00320.86
8.1.230.0080.00317.88
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0080.00017.35
8.1.190.0040.00417.35
8.1.180.0030.00918.10
8.1.170.0080.00018.48
8.1.160.0000.00718.80
8.1.150.0070.00018.89
8.1.140.0000.00822.11
8.1.130.0070.00020.14
8.1.120.0030.00317.40
8.1.110.0070.00417.38
8.1.100.0030.00517.44
8.1.90.0070.00017.32
8.1.80.0080.00017.46
8.1.70.0000.00917.43
8.1.60.0000.00817.45
8.1.50.0060.00317.45
8.1.40.0040.00417.52
8.1.30.0060.00317.66
8.1.20.0050.00217.57
8.1.10.0030.00617.52
8.1.00.0000.00817.46
8.0.300.0070.00018.77
8.0.290.0080.00016.75
8.0.280.0030.00318.33
8.0.270.0070.00017.27
8.0.260.0000.00718.45
8.0.250.0030.00617.03
8.0.240.0030.00316.91
8.0.230.0000.00716.98
8.0.220.0030.00316.81
8.0.210.0000.00616.95
8.0.200.0000.00816.84
8.0.190.0000.00716.99
8.0.180.0080.00016.81
8.0.170.0040.00416.93
8.0.160.0040.00416.85
8.0.150.0000.00716.87
8.0.140.0040.00416.89
8.0.130.0000.00713.28
8.0.120.0070.00016.97
8.0.110.0040.00416.76
8.0.100.0000.00716.88
8.0.90.0000.00716.87
8.0.80.0130.00316.86
8.0.70.0000.00716.80
8.0.60.0040.00416.91
8.0.50.0040.00416.75
8.0.30.0090.01117.16
8.0.20.0090.00917.40
8.0.10.0040.00417.09
8.0.00.0110.00716.84
7.4.330.0000.00515.55
7.4.320.0030.00316.52
7.4.300.0060.00016.45
7.4.290.0060.00016.40
7.4.280.0060.00316.64
7.4.270.0000.00816.43
7.4.260.0000.00716.57
7.4.250.0000.00716.48
7.4.240.0040.00416.52
7.4.230.0080.00016.61
7.4.220.0020.00516.69
7.4.210.0080.00716.66
7.4.200.0000.00716.58
7.4.160.0110.00716.49
7.4.140.0130.00817.86
7.4.130.0100.00716.50
7.4.120.0110.00916.48
7.4.110.0130.00716.47
7.4.100.0130.00316.45
7.4.90.0090.01516.63
7.4.80.0090.00919.39
7.4.70.0070.01016.48
7.4.60.0120.00616.43
7.4.50.0060.01016.51
7.4.40.0100.00716.22
7.4.00.0040.00715.20
7.3.330.0000.00513.16
7.3.320.0050.00013.16
7.3.310.0030.00516.41
7.3.300.0030.00316.34
7.3.290.0000.00716.12
7.3.280.0070.00816.19
7.3.260.0120.00716.32
7.3.240.0090.01116.40
7.3.230.0180.00316.59
7.3.210.0140.00316.36
7.3.200.0030.01516.57
7.3.190.0100.00716.38
7.3.180.0120.00416.50
7.3.170.0170.00016.36
7.3.160.0060.00916.31
7.2.330.0070.01016.79
7.2.320.0100.01316.80
7.2.310.0200.01216.40
7.2.300.0150.00916.44
7.2.290.0040.01516.36
7.2.110.0610.00915.10
7.2.100.0670.00914.95
7.2.90.0900.00014.51
7.2.80.0850.00314.74
7.2.70.0500.01015.14
7.2.60.0520.00914.65
7.2.50.0730.00714.51
7.2.40.0670.00315.05
7.2.30.0550.01214.82
7.2.20.0560.01014.90
7.2.10.0590.00614.99
7.2.00.0620.00615.18
7.1.230.0480.00713.61
7.1.220.0950.00713.92
7.1.210.0900.00313.85
7.1.200.0770.00613.97
7.1.190.0590.00413.95
7.1.180.0560.00813.75
7.1.170.0800.00913.90
7.1.160.0540.00613.86
7.1.150.0660.00613.82
7.1.140.0780.01013.85
7.1.130.0640.01013.83
7.1.120.0600.01014.05
7.1.110.1240.01014.02
7.1.100.0770.00313.59
7.1.90.0650.00313.83
7.1.80.0630.01014.02
7.1.70.0610.00613.57
7.1.60.0840.00331.50
7.1.50.1210.01331.45
7.1.40.1050.00431.84
7.1.30.1110.00331.91
7.1.20.1380.01031.64
7.1.10.0790.00913.38
7.1.00.0680.00713.96
5.6.380.0070.01013.97

preferences:
42.77 ms | 400 KiB | 5 Q