3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data_json = '{ "EXPORT": [ { "dates": "2019-07-01", "c_job": 12 }, { "dates": "2019-07-02", "c_job": 8 }, { "dates": "2019-07-04", "c_job": 11 } ], "IMPORT": [ { "dates": "2019-07-03", "c_job": 11 } ] }'; $blank_json = '[ { "dates": "2019-07-01", "c_job": 0 }, { "dates": "2019-07-02", "c_job": 0 }, { "dates": "2019-07-03", "c_job": 0 }, { "dates": "2019-07-04", "c_job": 0 } ]'; $data = json_decode($data_json, true); $blank = json_decode($blank_json, true); $datafinal = array(); foreach ($data as $key => $value) { foreach ($blank as $bkey => $bvalue) { if (($dkey = array_search($bvalue['dates'], array_column($value, 'dates'))) !== false) { $datafinal[$key][$bkey] = $value[$dkey]; } else { $datafinal[$key][$bkey] = $bvalue; } } } echo json_encode($datafinal, JSON_PRETTY_PRINT);

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.4.20.0140.00718.79
8.4.10.0120.00317.75
8.3.150.0130.00320.80
8.3.140.0080.00019.14
8.3.130.0050.00316.63
8.3.120.0040.00418.90
8.3.110.0030.00620.94
8.3.100.0080.00024.06
8.3.90.0040.01418.57
8.3.80.0100.00018.30
8.3.70.0000.01518.30
8.3.60.0140.00718.28
8.3.50.0110.00621.07
8.3.40.0140.00418.79
8.3.30.0090.00618.84
8.3.20.0040.00423.57
8.3.10.0060.00322.10
8.3.00.0000.00822.39
8.2.270.0110.00717.04
8.2.260.0100.01018.34
8.2.250.0060.00318.58
8.2.240.0090.00017.27
8.2.230.0050.00322.58
8.2.220.0080.00337.54
8.2.210.0150.00026.77
8.2.200.0000.00816.63
8.2.190.0140.00316.63
8.2.180.0150.00618.18
8.2.170.0090.00922.96
8.2.160.0060.00922.21
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0000.00826.16
8.2.110.0100.01321.06
8.2.100.0040.00717.72
8.2.90.0040.00420.46
8.2.80.0030.00520.36
8.2.70.0000.00817.63
8.2.60.0000.00817.63
8.2.50.0000.00917.63
8.2.40.0000.00719.47
8.2.30.0000.00719.39
8.2.20.0030.00618.05
8.2.10.0050.00319.31
8.2.00.0020.00519.22
8.1.310.0040.01118.56
8.1.300.0000.00818.48
8.1.290.0000.00918.88
8.1.280.0110.00325.92
8.1.270.0030.00520.88
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0040.00422.14
8.1.230.0040.00720.97
8.1.220.0080.00017.74
8.1.210.0040.00418.89
8.1.200.0080.00017.35
8.1.190.0080.00017.09
8.1.180.0040.00418.10
8.1.170.0030.00518.51
8.1.160.0000.00818.90
8.1.150.0080.00018.81
8.1.140.0000.00720.84
8.1.130.0070.00020.15
8.1.120.0030.00317.43
8.1.110.0090.00017.50
8.1.100.0040.00717.52
8.1.90.0070.00017.46
8.1.80.0040.00417.39
8.1.70.0070.00017.35
8.1.60.0090.00017.64
8.1.50.0000.00817.41
8.1.40.0030.00617.49
8.1.30.0040.00417.55
8.1.20.0000.00917.55
8.1.10.0040.00417.55
8.1.00.0030.00617.53
8.0.300.0030.00520.14
8.0.290.0040.00416.63
8.0.280.0040.00418.36
8.0.270.0000.00717.19
8.0.260.0060.00020.18
8.0.250.0040.00416.86
8.0.240.0030.00316.99
8.0.230.0050.00217.04
8.0.220.0030.00316.91
8.0.210.0000.00816.84
8.0.200.0080.00016.95
8.0.190.0030.00516.98
8.0.180.0060.00316.93
8.0.170.0090.00316.85
8.0.160.0070.00016.88
8.0.150.0040.00416.79
8.0.140.0030.00516.84
8.0.130.0030.00313.36
8.0.120.0000.00716.75
8.0.110.0000.00816.92
8.0.100.0070.00017.01
8.0.90.0000.00716.78
8.0.80.0090.00616.91
8.0.70.0000.00716.75
8.0.60.0000.00716.86
8.0.50.0000.00717.01
8.0.30.0090.00917.11
8.0.20.0080.01217.06
8.0.10.0040.00417.06
8.0.00.0100.00916.70
7.4.330.0000.00415.55
7.4.320.0060.00016.52
7.4.300.0000.00716.52
7.4.290.0080.00016.63
7.4.280.0000.00816.45
7.4.270.0070.00016.56
7.4.260.0000.00513.30
7.4.250.0050.00216.39
7.4.240.0020.00516.55
7.4.230.0040.00416.54
7.4.220.0060.00116.71
7.4.210.0100.00816.70
7.4.200.0070.00016.49
7.4.140.0000.01617.86
7.4.130.0100.01416.52
7.4.120.0070.01016.35
7.4.110.0100.00716.34
7.4.100.0140.00316.41
7.4.90.0110.01316.57
7.4.80.0090.00919.39
7.4.70.0060.01216.47
7.4.60.0100.00716.54
7.4.50.0100.00616.36
7.4.40.0120.01216.43
7.4.00.0090.00614.98
7.3.330.0030.00616.46
7.3.320.0030.00313.07
7.3.310.0070.00016.40
7.3.300.0030.00316.24
7.3.290.0080.00616.41
7.3.280.0040.01116.34
7.3.260.0110.00916.52
7.3.240.0080.01116.37
7.3.230.0090.00916.53
7.3.210.0090.00616.48
7.3.200.0120.00616.59
7.3.190.0000.02216.49
7.3.180.0060.01116.51
7.3.170.0060.00916.36
7.3.160.0090.00916.29
7.3.80.0090.00915.00
7.3.70.0100.01014.79
7.3.60.0100.00714.64
7.3.50.0080.00814.97
7.3.40.0070.00715.00
7.3.30.0030.01014.65
7.3.20.0140.00314.79
7.3.10.0080.01614.54
7.3.00.0140.00414.96
7.2.330.0110.00816.86
7.2.320.0110.00616.54
7.2.310.0050.01116.89
7.2.300.0060.01216.76
7.2.290.0110.00316.77
7.2.210.0050.01014.91
7.2.200.0100.01015.11
7.2.190.0040.01414.96
7.2.180.0030.01315.06
7.2.170.0060.00815.18
7.2.160.0090.00615.12
7.2.150.0120.00615.14
7.2.140.0130.00715.17
7.2.130.0120.00615.28
7.2.120.0070.01114.96
7.2.110.0090.00914.89
7.2.100.0090.00915.05
7.2.90.0250.00615.27
7.2.80.0090.00915.00
7.2.70.0130.00615.01
7.2.60.0080.01615.25
7.2.50.0100.01015.18
7.2.40.0110.00715.22
7.2.30.0170.00315.38
7.2.20.0130.00615.22
7.2.10.0150.00314.95
7.2.00.0090.00915.28
7.1.310.0150.00313.90
7.1.300.0150.00813.90
7.1.290.0110.00613.97
7.1.280.0170.00713.80
7.1.270.0920.01014.05
7.1.260.0140.00313.61
7.1.250.0070.01014.00

preferences:
120.89 ms | 403 KiB | 5 Q