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.70.0120.00616.61
8.3.60.0090.00918.55
8.3.50.0080.00618.07
8.3.40.0120.00318.79
8.3.30.0070.01418.45
8.3.20.0040.00419.16
8.3.10.0000.00821.77
8.3.00.0000.00720.39
8.2.180.0110.00418.16
8.2.170.0090.00622.96
8.2.160.0070.00720.89
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00419.82
8.2.120.0040.00426.35
8.2.110.0060.00321.02
8.2.100.0040.00818.03
8.2.90.0030.00617.88
8.2.80.0040.00417.97
8.2.70.0060.00318.05
8.2.60.0090.00018.16
8.2.50.0040.00418.10
8.2.40.0000.00719.47
8.2.30.0030.00619.42
8.2.20.0040.00418.18
8.2.10.0000.00818.19
8.2.00.0030.00617.79
8.1.280.0000.01525.92
8.1.270.0030.00618.83
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0000.00922.59
8.1.230.0000.01022.10
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0030.00617.38
8.1.190.0000.00817.35
8.1.180.0040.00718.10
8.1.170.0000.00818.55
8.1.160.0040.00418.88
8.1.150.0000.00818.85
8.1.140.0040.00422.06
8.1.130.0080.00020.06
8.1.120.0040.00317.34
8.1.110.0000.00917.47
8.1.100.0040.00417.47
8.1.90.0040.00417.49
8.1.80.0070.00017.52
8.1.70.0100.00017.41
8.1.60.0030.00517.55
8.1.50.0030.00517.48
8.1.40.0070.00017.55
8.1.30.0030.00717.51
8.1.20.0040.00417.66
8.1.10.0040.00417.45
8.1.00.0000.00817.39
8.0.300.0060.00318.77
8.0.290.0070.00316.59
8.0.280.0000.00718.44
8.0.270.0030.00317.30
8.0.260.0030.00318.36
8.0.250.0000.00917.05
8.0.240.0030.00317.05
8.0.230.0070.00017.04
8.0.220.0080.00016.94
8.0.210.0070.00016.93
8.0.200.0000.00616.95
8.0.190.0070.00017.05
8.0.180.0040.00417.00
8.0.170.0060.00316.88
8.0.160.0070.00016.94
8.0.150.0050.00316.79
8.0.140.0000.00716.93
8.0.130.0030.00613.34
8.0.120.0040.00416.82
8.0.110.0000.00817.00
8.0.100.0000.00716.83
8.0.90.0070.00016.82
8.0.80.0110.00516.92
8.0.70.0030.00517.02
8.0.60.0040.00416.82
8.0.50.0040.00416.80
8.0.30.0080.01017.14
8.0.20.0120.00617.40
8.0.10.0040.00417.12
8.0.00.0120.00616.79
7.4.330.0050.00015.55
7.4.320.0000.00616.58
7.4.300.0030.00416.63
7.4.290.0060.00016.50
7.4.280.0060.00316.39
7.4.270.0000.00716.56
7.4.260.0050.00316.56
7.4.250.0030.00316.59
7.4.240.0070.00016.49
7.4.230.0040.00316.30
7.4.220.0040.00416.42
7.4.210.0090.01216.49
7.4.200.0000.00716.59
7.4.160.0080.00816.60
7.4.140.0110.00817.86
7.4.130.0100.00716.43
7.4.120.0090.00916.49
7.4.110.0100.01016.38
7.4.100.0070.01016.48
7.4.90.0030.01916.53
7.4.80.0120.00619.39
7.4.70.0090.00816.50
7.4.60.0150.00316.28
7.4.50.0030.01316.36
7.4.40.0120.00616.55
7.4.00.0040.01214.83
7.3.330.0030.00313.28
7.3.320.0020.00213.20
7.3.310.0040.00416.27
7.3.300.0030.00316.36
7.3.290.0000.00716.42
7.3.280.0070.01016.37
7.3.260.0100.00716.49
7.3.240.0100.00816.52
7.3.230.0120.00916.43
7.3.210.0070.01016.45
7.3.200.0000.01616.52
7.3.190.0120.00916.62
7.3.180.0080.00816.44
7.3.170.0100.00716.36
7.3.160.0100.00716.62
7.3.120.0090.00914.89
7.3.110.0140.00414.85
7.3.100.0060.00914.83
7.3.90.0090.00614.82
7.3.80.0080.00015.14
7.3.70.0100.00314.78
7.3.60.0030.01014.89
7.3.50.0110.00014.61
7.3.40.0000.01114.84
7.3.30.0000.01314.95
7.3.20.0030.01016.72
7.3.10.0090.00316.54
7.3.00.0000.00916.59
7.2.330.0060.01216.43
7.2.320.0030.01716.71
7.2.310.0090.00916.80
7.2.300.0090.01516.74
7.2.290.0080.00816.77
7.2.240.0060.00915.07
7.2.230.0040.01115.14
7.2.220.0060.00915.11
7.2.210.0070.00715.03
7.2.200.0090.00314.99
7.2.190.0070.00715.25
7.2.180.0000.01115.04
7.2.170.0110.00315.08
7.2.160.0030.01015.23
7.2.150.0000.01116.85
7.2.140.0030.00717.00
7.2.130.0070.01016.94
7.2.120.0070.00717.00
7.2.110.0320.00616.01
7.2.100.0280.00815.85
7.2.90.0430.00815.76
7.2.80.0320.00715.87
7.2.70.0570.00515.95
7.2.60.0360.00716.00
7.2.50.0290.00515.88
7.2.40.0280.00715.79
7.2.30.0280.01315.95
7.2.20.0400.01115.97
7.2.10.0360.00515.82
7.2.00.0450.00816.09
7.1.330.0030.01215.57
7.1.320.0040.01115.78
7.1.310.0050.00316.00
7.1.300.0030.01015.55
7.1.290.0040.00415.53
7.1.280.0100.00315.92
7.1.270.0070.00415.79
7.1.260.0030.01415.83
7.1.250.0030.01315.77
7.1.230.0580.00414.00
7.1.220.0420.00814.12
7.1.210.0630.01013.88
7.1.200.0400.01313.92
7.1.190.0440.00814.08
7.1.180.0730.00013.82
7.1.170.0550.01213.83
7.1.160.0500.01013.66
7.1.150.0610.00713.60
7.1.140.0990.00913.61
7.1.130.0880.00713.73
7.1.120.0870.00314.01
7.1.110.0530.00713.94
7.1.100.0500.01013.82
7.1.90.0550.00613.84
7.1.80.0540.01014.15
7.1.70.0720.00313.83
7.1.60.0660.01132.14
7.1.50.1010.01331.87
7.1.40.1040.01031.75
7.1.30.1080.01031.70
7.1.20.0950.01031.81
7.1.10.0720.00714.11
7.1.00.0570.00714.03
5.6.380.0150.00914.68

preferences:
56.42 ms | 401 KiB | 5 Q