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.0140.00016.63
8.3.50.0080.01021.93
8.3.40.0040.01119.14
8.3.30.0100.00319.04
8.3.20.0050.00320.29
8.3.10.0070.00023.68
8.3.00.0080.00019.68
8.2.180.0180.00316.75
8.2.170.0140.00022.96
8.2.160.0130.00020.43
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00019.36
8.2.110.0000.00922.27
8.2.100.0110.00017.84
8.2.90.0000.00719.40
8.2.80.0080.00017.97
8.2.70.0000.00917.63
8.2.60.0000.01117.91
8.2.50.0030.00718.07
8.2.40.0000.00820.01
8.2.30.0040.00418.24
8.2.20.0040.00417.72
8.2.10.0070.00018.00
8.2.00.0000.00817.81
8.1.280.0070.00725.92
8.1.270.0000.00823.91
8.1.260.0030.00526.35
8.1.250.0000.00728.09
8.1.240.0060.00323.66
8.1.230.0040.00718.98
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0040.00417.36
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0030.00518.54
8.1.160.0000.00721.94
8.1.150.0070.00018.54
8.1.140.0040.00417.45
8.1.130.0030.00317.81
8.1.120.0040.00417.52
8.1.110.0050.00317.42
8.1.100.0000.00817.47
8.1.90.0000.00717.42
8.1.80.0000.00817.45
8.1.70.0070.00017.46
8.1.60.0040.00417.54
8.1.50.0040.00417.51
8.1.40.0000.00717.52
8.1.30.0050.00317.71
8.1.20.0030.00517.66
8.1.10.0030.00617.47
8.1.00.0030.00517.35
8.0.300.0030.00318.77
8.0.290.0040.00416.88
8.0.280.0040.00418.32
8.0.270.0030.00317.18
8.0.260.0000.00617.27
8.0.250.0030.00417.04
8.0.240.0080.00016.99
8.0.230.0030.00616.90
8.0.220.0030.00316.93
8.0.210.0070.00016.93
8.0.200.0030.00317.00
8.0.190.0000.00817.00
8.0.180.0000.00917.00
8.0.170.0000.00816.91
8.0.160.0000.00816.87
8.0.150.0040.00416.85
8.0.140.0030.00316.90
8.0.130.0030.00313.39
8.0.120.0040.00416.97
8.0.110.0040.00417.00
8.0.100.0030.00517.07
8.0.90.0040.00416.79
8.0.80.0030.01216.98
8.0.70.0000.00716.77
8.0.60.0000.00716.83
8.0.50.0040.00416.77
8.0.30.0100.01016.99
8.0.20.0170.00717.41
8.0.10.0000.00717.02
8.0.00.0050.01216.71
7.4.330.0050.00015.14
7.4.320.0050.00316.65
7.4.300.0040.00416.59
7.4.290.0020.00516.60
7.4.280.0040.00416.64
7.4.270.0030.00316.52
7.4.260.0070.00016.58
7.4.250.0000.00716.43
7.4.240.0020.00516.50
7.4.230.0070.00016.58
7.4.220.0030.02416.62
7.4.210.0070.00716.63
7.4.200.0030.00316.71
7.4.160.0120.00416.31
7.4.150.0090.00917.40
7.4.140.0080.01217.86
7.4.130.0100.00616.57
7.4.120.0110.00616.59
7.4.110.0130.00316.45
7.4.100.0090.01216.69
7.4.90.0040.01416.48
7.4.80.0140.00719.39
7.4.70.0100.01016.52
7.4.60.0090.00916.64
7.4.50.0020.00216.29
7.4.40.0060.00916.46
7.4.30.0030.01316.52
7.4.00.0070.00714.97
7.3.330.0000.00513.23
7.3.320.0000.00513.32
7.3.310.0000.00716.45
7.3.300.0000.00716.38
7.3.290.0130.00616.35
7.3.280.0100.00916.40
7.3.270.0130.00717.40
7.3.260.0130.01016.59
7.3.250.0110.01116.45
7.3.240.0090.00916.41
7.3.230.0140.00316.63
7.3.210.0130.00716.43
7.3.200.0060.01616.60
7.3.190.0030.01516.35
7.3.180.0060.00916.42
7.3.170.0040.01116.45
7.3.160.0040.01216.57
7.3.120.0090.00614.94
7.2.330.0140.00316.41
7.2.320.0090.01616.69
7.2.310.0090.00916.72
7.2.300.0120.00316.80
7.2.290.0080.00816.59
7.2.60.0140.00016.58
7.2.00.0060.00619.52
7.1.200.0080.00415.86
7.1.100.0030.00918.34
7.1.70.0050.00317.17
7.1.60.0170.00719.70
7.1.50.0110.01516.73
7.1.00.0070.07322.46
7.0.200.0030.01016.80
7.0.140.0030.07021.97
7.0.60.0070.08319.95
7.0.50.0130.07017.66
7.0.40.0030.04320.40
7.0.30.0270.08320.04
7.0.20.0270.04720.22
7.0.10.0100.06020.12
7.0.00.0070.05020.32
5.6.280.0070.07020.99
5.6.210.0130.07020.54
5.6.200.0100.07718.23
5.6.190.0130.07320.46
5.6.180.3430.05020.27
5.6.170.0270.07720.49
5.6.160.0100.08020.38
5.6.150.0070.04718.18
5.6.140.0130.03018.14
5.6.130.0070.04018.09
5.6.120.0130.07720.96
5.6.110.0030.06020.98
5.6.100.0030.04320.97
5.6.90.0170.05021.09
5.6.80.0030.08320.43
5.6.70.3370.04320.27
5.5.350.0070.08320.40
5.5.340.0030.04718.00
5.5.330.0130.08320.43
5.5.320.0270.08020.32
5.5.310.0270.06320.42
5.5.300.0000.04717.89
5.5.290.0000.07718.01
5.5.280.0070.08720.80
5.5.270.0100.08320.97
5.5.260.0130.05720.64
5.5.250.0030.04020.58
5.5.240.0400.05320.15
5.4.450.0700.04743.89
5.4.440.0400.04743.83
5.4.430.0330.04043.77
5.4.420.0170.04343.77
5.4.410.0170.05343.77
5.4.400.0500.03043.77
5.4.390.0170.03719.13
5.4.380.0070.06318.68
5.4.370.0200.07018.50
5.4.360.0170.05018.66
5.4.350.0070.07018.61
5.4.340.0200.04718.46
5.4.320.0070.03512.46
5.4.310.0080.03512.45
5.4.300.0060.03612.46
5.4.290.0090.04512.45
5.4.280.0060.03512.35
5.4.270.0070.03512.35
5.4.260.0070.03912.35
5.4.250.0090.03312.35
5.4.240.0070.03812.35
5.4.230.0040.03912.34
5.4.220.0050.04112.34
5.4.210.0070.03812.34
5.4.200.0090.03812.34
5.4.190.0060.03912.34
5.4.180.0060.03612.34
5.4.170.0080.03312.35
5.4.160.0060.03812.35
5.4.150.0070.04212.34
5.4.140.0050.04312.03
5.4.130.0070.03812.01
5.4.120.0050.03611.97
5.4.110.0060.04611.97
5.4.100.0070.04711.97
5.4.90.0070.04311.97
5.4.80.0070.03611.97
5.4.70.0060.03411.96
5.4.60.0060.03411.96
5.4.50.0040.03811.96
5.4.40.0060.03411.95
5.4.30.0050.03611.95
5.4.20.0060.04211.95
5.4.10.0100.03611.95
5.4.00.0060.03911.44
5.3.290.0080.04212.80
5.3.280.0040.03912.70
5.3.270.0060.04412.72
5.3.260.0090.03612.72
5.3.250.0040.03912.72
5.3.240.0050.03812.72
5.3.230.0040.03912.71
5.3.220.0120.03212.68
5.3.210.0030.04212.68
5.3.200.0040.04512.68
5.3.190.0080.03612.68
5.3.180.0040.04712.67
5.3.170.0090.03912.67
5.3.160.0050.03812.67
5.3.150.0070.03512.68
5.3.140.0080.03412.66
5.3.130.0050.03912.65
5.3.120.0070.03712.65
5.3.110.0050.04012.66
5.3.100.0040.03812.12
5.3.90.0090.03912.08
5.3.80.0080.03712.07
5.3.70.0050.04612.08
5.3.60.0060.03712.06
5.3.50.0070.03612.00
5.3.40.0090.03912.00
5.3.30.0130.04311.94
5.3.20.0080.04611.72
5.3.10.0080.04611.69
5.3.00.0100.04611.68
5.2.170.0010.0379.18
5.2.160.0050.0359.18
5.2.150.0060.0299.17
5.2.140.0050.0319.17
5.2.130.0050.0309.14
5.2.120.0050.0329.13
5.2.110.0070.0269.14
5.2.100.0040.0289.14
5.2.90.0020.0359.14
5.2.80.0060.0289.13
5.2.70.0050.0349.13
5.2.60.0040.0319.09
5.2.50.0040.0309.05
5.2.40.0040.0289.03
5.2.30.0040.0309.01
5.2.20.0050.0289.00
5.2.10.0040.0328.93
5.2.00.0080.0248.79
5.1.60.0080.0218.08
5.1.50.0060.0238.07
5.1.40.0050.0238.06
5.1.30.0070.0238.41
5.1.20.0070.0248.43
5.1.10.0060.0268.15
5.1.00.0010.0288.15
5.0.50.0030.0216.63
5.0.40.0030.0206.50
5.0.30.0060.0306.30
5.0.20.0030.0206.27
5.0.10.0040.0276.25
5.0.00.0030.0326.24
4.4.90.0030.0164.77
4.4.80.0030.0164.75
4.4.70.0040.0154.75
4.4.60.0040.0144.75
4.4.50.0040.0144.77
4.4.40.0050.0234.71
4.4.30.0010.0174.76
4.4.20.0030.0164.84
4.4.10.0050.0144.85
4.4.00.0040.0254.76
4.3.110.0040.0174.67
4.3.100.0020.0184.66
4.3.90.0030.0164.64
4.3.80.0040.0244.58
4.3.70.0020.0154.63
4.3.60.0030.0144.63
4.3.50.0040.0144.63
4.3.40.0020.0244.54
4.3.30.0020.0213.29
4.3.20.0040.0193.27
4.3.10.0060.0313.23
4.3.00.0070.01743.76

preferences:
36.14 ms | 401 KiB | 5 Q