3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_1 = array( 'apple'=>1,'banana'=>2,'coconut'=> 3); $array_2 = array( 'apple'=>2,'banana'=>3,'coconut'=> 4); foreach( $array_1 as $fruit => $num) { if(array_key_exists($fruit, $array_2)){ //check if key from array_1 exists in array_2 $final_array[] = array($fruit => $array_1[$fruit].','.$array_2[$fruit]); //concatenate values from shared key } } print_r ($final_array);

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.75
8.3.50.0190.00622.05
8.3.40.0060.00918.76
8.3.30.0070.00718.83
8.3.20.0040.00420.21
8.3.10.0080.00023.39
8.3.00.0080.00019.56
8.2.180.0070.01118.14
8.2.170.0130.00922.96
8.2.160.0070.01020.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.36
8.2.110.0030.00622.25
8.2.100.0110.00018.03
8.2.90.0080.00019.29
8.2.80.0090.00017.97
8.2.70.0000.00917.63
8.2.60.0000.00817.93
8.2.50.0030.00718.07
8.2.40.0040.00418.34
8.2.30.0000.00718.29
8.2.20.0050.00217.79
8.2.10.0040.00418.00
8.2.00.0060.00317.75
8.1.280.0100.00325.92
8.1.270.0060.00323.85
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0000.00822.19
8.1.230.0110.00019.09
8.1.220.0030.00517.75
8.1.210.0040.00418.77
8.1.200.0000.01017.35
8.1.190.0000.00817.10
8.1.180.0050.00318.10
8.1.170.0070.00318.52
8.1.160.0030.00322.06
8.1.150.0040.00418.54
8.1.140.0040.00417.53
8.1.130.0000.00717.70
8.1.120.0040.00417.46
8.1.110.0040.00417.46
8.1.100.0000.00717.44
8.1.90.0000.00717.39
8.1.80.0000.00717.35
8.1.70.0000.00717.40
8.1.60.0050.00217.49
8.1.50.0000.00917.59
8.1.40.0000.00717.54
8.1.30.0000.00817.57
8.1.20.0040.00417.55
8.1.10.0000.00717.51
8.1.00.0000.00717.32
8.0.300.0000.00718.77
8.0.290.0070.00016.75
8.0.280.0000.00718.41
8.0.270.0030.00317.17
8.0.260.0040.00417.21
8.0.250.0050.00216.96
8.0.240.0000.00916.84
8.0.230.0030.00316.89
8.0.220.0000.00716.91
8.0.210.0030.00316.80
8.0.200.0030.00316.95
8.0.190.0000.00716.87
8.0.180.0040.00416.91
8.0.170.0030.00516.81
8.0.160.0040.00416.84
8.0.150.0000.00816.88
8.0.140.0050.00216.84
8.0.130.0060.00013.31
8.0.120.0000.00716.85
8.0.110.0040.00416.84
8.0.100.0000.00716.84
8.0.90.0070.00016.72
8.0.80.0000.01516.87
8.0.70.0040.00416.86
8.0.60.0040.00416.93
8.0.50.0080.00016.88
8.0.30.0100.01317.18
8.0.20.0040.01617.40
8.0.10.0040.00416.80
8.0.00.0090.00816.78
7.4.330.0000.00515.00
7.4.320.0060.00316.41
7.4.300.0060.00016.50
7.4.290.0060.00016.55
7.4.280.0060.00316.43
7.4.270.0040.00416.60
7.4.260.0080.00316.52
7.4.250.0030.00316.37
7.4.240.0050.00316.50
7.4.230.0040.00416.70
7.4.220.0080.01416.46
7.4.210.0070.01316.50
7.4.200.0070.00016.32
7.4.160.0070.01016.39
7.4.150.0130.01317.40
7.4.140.0080.01017.86
7.4.130.0110.00816.58
7.4.120.0110.00916.52
7.4.110.0100.00716.53
7.4.100.0140.00316.33
7.4.90.0060.01116.69
7.4.80.0060.01219.39
7.4.70.0070.01116.47
7.4.60.0120.00416.42
7.4.50.0030.00516.38
7.4.40.0090.00916.47
7.4.30.0090.00616.56
7.4.00.0090.00915.00
7.3.330.0020.00213.25
7.3.320.0050.00013.16
7.3.310.0030.00316.29
7.3.300.0050.00216.35
7.3.290.0050.01016.35
7.3.280.0070.01016.29
7.3.270.0060.01417.40
7.3.260.0210.00016.59
7.3.250.0100.00716.42
7.3.240.0060.01116.34
7.3.230.0040.01316.39
7.3.210.0100.00716.50
7.3.200.0150.00819.39
7.3.190.0220.00016.33
7.3.180.0130.00916.36
7.3.170.0000.01516.47
7.3.160.0070.01416.45
7.3.120.0080.00715.01
7.3.110.0150.00314.85
7.3.100.0120.00614.83
7.3.90.0070.01014.61
7.3.80.0100.00714.94
7.3.70.0060.00614.78
7.3.60.0090.00914.86
7.3.50.0090.00914.69
7.3.40.0040.00714.70
7.3.30.0030.00614.72
7.3.20.0100.00716.80
7.3.10.0040.00816.76
7.3.00.0090.00016.50
7.2.330.0170.00616.43
7.2.320.0100.00716.77
7.2.310.0060.01816.41
7.2.300.0060.00916.52
7.2.290.0110.00516.56
7.2.250.0060.01215.30
7.2.240.0180.00315.22
7.2.230.0090.00615.06
7.2.220.0060.01215.26
7.2.210.0040.01514.95
7.2.200.0030.00914.95
7.2.190.0090.00914.74
7.2.180.0030.01615.22
7.2.170.0030.01515.15
7.2.130.0090.00317.01
7.2.120.0000.01516.90
7.2.110.0060.00316.88
7.2.100.0090.00316.84
7.2.90.0060.00916.95
7.2.80.0040.00716.72
7.2.70.0070.00716.80
7.2.60.0040.00716.98
7.2.50.0000.01117.07
7.2.40.0040.00816.62
7.2.30.0000.01417.04
7.2.20.0000.01316.62
7.2.10.0000.01316.68
7.2.00.0140.00016.68
7.1.330.0070.00715.83
7.1.320.0030.01015.84
7.1.310.0060.00915.67
7.1.300.0030.01015.69
7.1.290.0100.00615.59
7.1.280.0070.00715.83
7.1.270.0090.00615.58
7.1.260.0100.00315.79
7.1.250.0000.00715.80
7.1.70.0050.00317.25
7.1.60.0060.01919.70
7.1.50.0000.02516.73
7.1.00.0030.07722.28
7.0.200.0090.00316.71
7.0.140.0100.06722.02
7.0.100.0170.06019.95
7.0.90.0000.05019.89
7.0.80.0230.03019.96
7.0.70.0000.06319.97
7.0.60.0330.07319.89
7.0.50.0070.05720.23
7.0.40.0000.07320.00
7.0.30.0070.08320.14
7.0.20.0070.08720.08
7.0.10.0130.07020.10
7.0.00.0130.05320.10
5.6.280.0100.06721.09
5.6.250.0070.05020.72
5.6.240.0130.08020.66
5.6.230.0100.07720.66
5.6.220.0070.07020.50
5.6.210.0100.07020.64
5.6.200.0070.06021.05
5.6.190.0000.06321.11
5.6.180.0100.07321.04
5.6.170.0100.04320.95
5.6.160.0130.08021.02
5.6.150.0030.06021.13
5.6.140.0130.05721.13
5.6.130.0070.08321.01
5.6.120.0070.08720.98
5.6.110.0070.05020.94
5.6.100.0000.05321.03
5.6.90.0030.05320.89
5.6.80.0070.07020.33
5.6.70.0100.08020.42
5.6.60.0130.05720.40
5.6.50.0000.08320.49
5.6.40.0100.03720.29
5.6.30.0100.03720.42
5.6.20.0070.03720.39
5.6.10.0030.04320.39
5.6.00.0030.04320.34
5.5.380.0130.04020.35
5.5.370.0030.08020.40
5.5.360.0030.08720.40
5.5.350.0000.09020.48
5.5.340.0100.08020.73
5.5.330.0070.08720.80
5.5.320.0070.07320.73
5.5.310.0170.07320.88
5.5.300.0130.08320.77
5.5.290.0030.09020.77
5.5.280.0000.05320.88
5.5.270.0130.05020.85
5.5.260.0070.05320.89
5.5.250.0000.08720.60
5.5.240.0200.03020.30
5.5.230.0070.08020.20
5.5.220.0100.07020.13
5.5.210.0100.07720.11
5.5.200.0100.03720.26
5.5.190.0030.04020.18
5.5.180.0070.03720.18
5.5.160.0030.03720.08
5.5.150.0030.04020.21
5.5.140.0030.04020.22
5.5.130.0070.03720.16
5.5.120.0030.04720.28
5.5.110.0100.03320.11
5.5.100.0070.03320.12
5.5.90.0030.04320.08
5.5.80.0030.03720.16
5.5.70.0030.04020.06
5.5.60.0070.03720.15
5.5.50.0100.02719.96
5.5.40.0030.03719.89
5.5.30.0100.03720.07
5.5.20.0070.03719.95
5.5.10.0030.04320.05
5.5.00.0000.04320.07
5.4.450.0130.07019.50
5.4.440.0070.04719.50
5.4.430.0070.08319.41
5.4.420.0130.02719.35
5.4.410.0130.06319.24
5.4.400.0170.06319.09
5.4.390.0030.03719.09
5.4.380.0170.06719.14
5.4.370.0100.04018.87
5.4.360.0000.04319.04
5.4.350.0030.04318.87
5.4.340.0070.04319.12
5.4.320.0070.03719.05
5.4.310.0070.03718.86
5.4.300.0030.04318.95
5.4.290.0030.04019.04
5.4.280.0070.03319.09
5.4.270.0030.07019.04
5.4.260.0000.04019.04
5.4.250.0100.03319.09
5.4.240.0000.04319.11
5.4.230.0070.03318.84
5.4.220.0070.04319.07
5.4.210.0100.07718.90
5.4.200.0070.03718.86
5.4.190.0030.04019.01
5.4.180.0030.03719.13
5.4.170.0030.03719.11
5.4.160.0070.05718.85
5.4.150.0030.04019.11
5.4.140.0070.04316.43
5.4.130.0100.07716.45
5.4.120.0030.07316.24
5.4.110.0070.07716.32
5.4.100.0130.07316.50
5.4.90.0030.07716.50
5.4.80.0030.05316.48
5.4.70.0130.05316.41
5.4.60.0070.07316.29
5.4.50.0030.06716.33
5.4.40.0070.07316.48
5.4.30.0170.03016.29
5.4.20.0170.05716.45
5.4.10.0170.05316.47
5.4.00.0100.07015.89
5.3.290.0070.03314.64
5.3.280.0130.03314.60
5.3.270.0030.05714.52
5.3.260.0000.03714.55
5.3.250.0070.07014.64
5.3.240.0030.05014.53
5.3.230.0100.07714.65
5.3.220.0030.04714.70
5.3.210.0100.06014.65
5.3.200.0000.03714.64
5.3.190.0030.07314.70
5.3.180.0130.06714.48
5.3.170.0170.06714.50
5.3.160.0100.07714.63
5.3.150.0070.07314.64
5.3.140.0000.04714.67
5.3.130.0070.06714.66
5.3.120.0000.05714.55
5.3.110.0100.03714.49
5.3.100.0030.08314.00
5.3.90.0070.06714.07
5.3.80.0070.06313.90
5.3.70.0030.04013.99
5.3.60.0030.06313.91
5.3.50.0070.03714.03
5.3.40.0070.06013.94
5.3.30.0070.03013.92
5.3.20.0030.03313.79
5.3.10.0000.03313.53
5.3.00.0100.06713.68
5.2.170.0030.03312.74
5.2.160.0100.03312.74
5.2.150.0000.03712.74
5.2.140.0070.03012.74
5.2.130.0000.06012.74
5.2.120.0000.02712.74
5.2.110.0100.05312.74
5.2.100.0070.06012.74
5.2.90.0130.05712.74
5.2.80.0030.05012.74
5.2.70.0070.06312.74
5.2.60.0030.04312.74
5.2.50.0130.05012.74
5.2.40.0070.06012.74
5.2.30.0070.06312.74
5.2.20.0030.06012.74
5.2.10.0030.06312.74
5.2.00.0030.05012.74
5.1.60.0000.03712.74
5.1.50.0030.05312.74
5.1.40.0030.02712.74
5.1.30.0130.05012.74
5.1.20.0100.05312.74
5.1.10.0030.05312.74
5.1.00.0070.05012.74
5.0.50.0030.05012.74
5.0.40.0000.03012.74
5.0.30.0030.06712.74
5.0.20.0100.04012.74
5.0.10.0030.02312.74
5.0.00.0000.06712.74
4.4.90.0000.03712.74
4.4.80.0030.03012.74
4.4.70.0030.03312.74
4.4.60.0000.03712.74
4.4.50.0070.02312.74
4.4.40.0000.03012.74
4.4.30.0000.04012.74
4.4.20.0070.02012.74
4.4.10.0070.03012.74
4.4.00.0000.05312.74
4.3.110.0000.03712.74
4.3.100.0070.03012.74
4.3.90.0000.03312.74
4.3.80.0030.04312.74
4.3.70.0030.03712.74
4.3.60.0030.03712.74
4.3.50.0000.04012.74
4.3.40.0000.05312.74
4.3.30.0000.02312.74
4.3.20.0030.02312.74
4.3.10.0000.03712.74
4.3.00.0000.03712.74

preferences:
52.55 ms | 400 KiB | 5 Q