3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ [ 'id' => '7ac648ce-18aa-11e9-b673-005056be36b2', 'answer' => '1', 'id_question' => '39', 'pi' => 'very good', 'ca' => NULL, 'pic' => NULL, 'new_deadline' => NULL, 'reason' => NULL, 'notes' => NULL, 'deadline' => NULL ], [ 'id' => '8653ef3d-18aa-11e9-b673-005056be36b2', 'answer' => '3', 'id_question' => '40', 'pi' => 'no problem', 'ca' => NULL, 'pic' => NULL, 'new_deadline' => NULL, 'reason' => NULL, 'notes' => NULL, 'deadline' => NULL ] ]; $array2 = [ [ 'id' => '38', 'question' => 'Kebersihan Meja Counter dan Meja Fincoy ', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '39', 'question' => 'Seragam Sales Counter / Salesman* ', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '40', 'question' => 'Kerapihan Sales Counter', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '42', 'question' => 'Sales Guide', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '43', 'question' => 'Product Card', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '44', 'question' => 'Ketersediaan Buku Tamu', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '45', 'question' => 'Ketersediaan Price List', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '46', 'question' => 'Ketersedian Rak Brosur ', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ], [ 'id' => '47', 'question' => 'Ketersediaan Flyer*/brosur ', 'type' => 'NON DOS', 'last_root' => '1', 'exist_good' => '1', 'exist_not_good' => '0', 'not_exist' => '1', 'n_a' => '0' ] ]; foreach ($array1 as $row) { $result[$row['id_question']]['id'] = $row['id']; $result[$row['id_question']]['id_question'] = $row['id_question']; $result[$row['id_question']]['type'] = null; $result[$row['id_question']]['answer'] = $row['answer']; $result[$row['id_question']]['pi'] = $row['pi']; $result[$row['id_question']]['ca'] = $row['ca']; $result[$row['id_question']]['pic'] = $row['pic']; $result[$row['id_question']]['deadline'] = $row['deadline']; $result[$row['id_question']]['new_deadline'] = $row['new_deadline']; $result[$row['id_question']]['reason'] = $row['reason']; $result[$row['id_question']]['notes'] = $row['notes']; $result[$row['id_question']]['last_root'] = null; $result[$row['id_question']]['exist_good'] = null; $result[$row['id_question']]['exist_not_good'] = null; $result[$row['id_question']]['not_exist'] = null; $result[$row['id_question']]['n_a'] = null; } foreach ($array2 as $row) { if (isset($result[$row['id']])) { // default elements already declared, just overwrite the nulls // $row['question'] is omitted from data $result[$row['id']]['type'] = $row['type']; $result[$row['id']]['last_root'] = $row['last_root']; $result[$row['id']]['exist_good'] = $row['exist_good']; $result[$row['id']]['exist_not_good'] = $row['exist_not_good']; $result[$row['id']]['not_exist'] = $row['not_exist']; $result[$row['id']]['n_a'] = $row['n_a']; } else { $result[$row['id']]['id'] = $row['question']; // no id, so use question $result[$row['id']]['id_question'] = null; $result[$row['id']]['type'] = $row['type']; $result[$row['id']]['answer'] = null; $result[$row['id']]['pi'] = null; $result[$row['id']]['ca'] = null; $result[$row['id']]['pic'] = null; $result[$row['id']]['deadline'] = null; $result[$row['id']]['new_deadline'] = null; $result[$row['id']]['reason'] = null; $result[$row['id']]['notes'] = null; $result[$row['id']]['last_root'] = $row['last_root']; $result[$row['id']]['exist_good'] = $row['exist_good']; $result[$row['id']]['exist_not_good'] = $row['exist_not_good']; $result[$row['id']]['not_exist'] = $row['not_exist']; $result[$row['id']]['n_a'] = $row['n_a']; } } var_export($result);

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.120.0080.00920.69
8.4.110.0110.01022.50
8.4.100.0140.00718.65
8.4.90.0110.00519.11
8.4.80.0100.01118.71
8.4.70.0120.00918.12
8.4.60.0130.00818.64
8.4.50.0100.01118.74
8.4.40.0130.00619.20
8.4.30.0100.01017.86
8.4.20.0100.01020.30
8.4.10.0070.01317.54
8.3.250.0110.00819.01
8.3.240.0100.01017.20
8.3.230.0060.00516.87
8.3.220.0070.01219.16
8.3.210.0060.00218.53
8.3.200.0050.00416.91
8.3.190.0070.00817.18
8.3.180.0070.00918.42
8.3.170.0180.00017.28
8.3.160.0070.01418.29
8.3.150.0130.00720.82
8.3.140.0120.00316.81
8.3.130.0080.00018.32
8.3.120.0060.00920.72
8.3.110.0040.00420.94
8.3.100.0030.00624.06
8.3.90.0120.00626.77
8.3.80.0030.00717.97
8.3.70.0120.00817.00
8.3.60.0190.01118.67
8.3.50.0060.00719.25
8.3.40.0040.01118.96
8.3.30.0120.00318.77
8.3.20.0070.01022.03
8.3.10.0000.00723.66
8.3.00.0050.00223.52
8.2.290.0100.00920.79
8.2.280.0090.00118.73
8.2.270.0040.00816.94
8.2.260.0060.00316.62
8.2.250.0070.00718.34
8.2.240.0030.00619.10
8.2.230.0070.00422.58
8.2.220.0000.00937.54
8.2.210.0030.00526.77
8.2.200.0040.00418.54
8.2.190.0030.01216.75
8.2.180.0130.01016.63
8.2.170.0120.00322.96
8.2.160.0030.01020.43
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0070.00026.16
8.2.120.0040.00419.95
8.2.110.0070.00320.39
8.2.100.0040.00818.16
8.2.90.0000.00817.88
8.2.80.0000.00818.05
8.2.70.0050.00318.05
8.2.60.0040.00418.34
8.2.50.0030.00518.10
8.2.40.0040.00419.42
8.2.30.0030.00619.42
8.2.20.0000.00718.30
8.2.10.0070.00019.46
8.2.00.0030.00618.30
8.1.330.0100.01022.28
8.1.320.0100.00716.40
8.1.310.0090.00920.21
8.1.300.0120.00619.78
8.1.290.0050.00530.84
8.1.280.0100.01325.92
8.1.270.0040.00418.70
8.1.260.0040.00426.35
8.1.250.0060.00928.09
8.1.240.0070.00323.82
8.1.230.0030.00921.00
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0060.00317.60
8.1.190.0000.00817.48
8.1.180.0080.00018.10
8.1.170.0030.00518.76
8.1.160.0000.00819.01
8.1.150.0070.00019.07
8.1.140.0040.00419.06
8.1.130.0050.00217.44
8.1.120.0040.00417.58
8.1.110.0040.00417.62
8.1.100.0030.00617.58
8.1.90.0030.00517.48
8.1.80.0060.00317.36
8.1.70.0040.00417.59
8.1.60.0050.00517.70
8.1.50.0040.00717.60
8.1.40.0040.00417.66
8.1.30.0000.00817.82
8.1.20.0030.00617.74
8.1.10.0050.00517.54
8.1.00.0000.00717.54
8.0.300.0040.00419.70
8.0.290.0060.00316.75
8.0.280.0040.00418.63
8.0.270.0000.00717.25
8.0.260.0040.00416.95
8.0.250.0000.00716.96
8.0.240.0030.00317.12
8.0.230.0020.00516.95
8.0.220.0030.00317.02
8.0.210.0070.00017.04
8.0.200.0000.00616.96
8.0.190.0040.00417.09
8.0.180.0050.00317.04
8.0.170.0040.00417.05
8.0.160.0050.00316.90
8.0.150.0000.00717.03
8.0.140.0040.00416.98
8.0.130.0000.00813.40
8.0.120.0080.00016.96
8.0.110.0040.00416.93
8.0.100.0000.00817.08
8.0.90.0040.00417.04
8.0.80.0090.00917.04
8.0.70.0020.00516.84
8.0.60.0050.00316.83
8.0.50.0000.00817.05
8.0.30.0100.00717.19
8.0.20.0000.01817.40
8.0.10.0080.00017.11
8.0.00.0110.00716.78
7.4.330.0000.00515.55
7.4.320.0030.00316.61
7.4.300.0000.00616.48
7.4.290.0030.00516.67
7.4.280.0040.00416.54
7.4.270.0050.00516.64
7.4.260.0070.00016.63
7.4.250.0000.00816.49
7.4.240.0040.00416.73
7.4.230.0000.00816.84
7.4.220.0040.00416.52
7.4.210.0070.00716.64
7.4.200.0000.00716.80
7.4.160.0100.00816.58
7.4.140.0120.01017.86
7.4.130.0100.01016.64
7.4.120.0080.01216.76
7.4.110.0160.00716.62
7.4.100.0030.01416.59
7.4.90.0140.00416.56
7.4.80.0120.00919.39
7.4.70.0030.01316.45
7.4.60.0100.00716.55
7.4.50.0060.01316.50
7.4.40.0130.00316.74
7.4.10.0030.01514.91
7.4.00.0100.00815.15
7.3.330.0000.00613.38
7.3.320.0060.00013.29
7.3.310.0040.00416.58
7.3.300.0000.00816.42
7.3.290.0000.00616.48
7.3.280.0090.00716.48
7.3.260.0140.00516.57
7.3.240.0090.00916.50
7.3.230.0120.00916.39
7.3.210.0060.01216.43
7.3.200.0130.01016.73
7.3.190.0090.01316.56
7.3.180.0030.01416.31
7.3.170.0110.01216.52
7.3.160.0040.02016.41
7.3.130.0070.01115.03
7.3.120.0100.00615.13
7.3.110.0040.01514.88
7.3.100.0140.00014.73
7.3.90.0030.01414.86
7.3.80.0090.00614.95
7.3.70.0030.00614.85
7.3.60.0110.00014.95
7.3.50.0000.01014.93
7.3.40.0030.01014.93
7.3.30.0090.00914.91
7.3.20.0060.01016.55
7.3.10.0400.00315.65
7.3.00.0380.00915.95
7.2.330.0030.01616.93
7.2.320.0060.01116.75
7.2.310.0120.00616.84
7.2.300.0100.00716.68
7.2.290.0130.00616.58
7.2.260.0070.01415.27
7.2.250.0060.01215.36
7.2.240.0100.00315.41
7.2.230.0040.01514.96
7.2.220.0070.01015.43
7.2.210.0080.00815.14
7.2.200.0000.01615.43
7.2.190.0070.00715.25
7.2.180.0120.00315.20
7.2.170.0090.00915.06
7.2.160.0040.01515.14
7.2.150.0080.00617.02
7.2.140.0080.00817.03
7.2.130.0390.00316.01
7.2.120.0370.00216.04
7.2.110.0960.00516.00
7.2.100.0390.01016.09
7.2.90.0380.00916.03
7.2.80.0330.00915.99
7.2.70.0490.00516.08
7.2.60.0370.00716.12
7.2.50.0370.01315.99
7.2.40.0480.00915.76
7.2.30.0480.00716.03
7.2.20.0440.01215.92
7.2.10.0540.00716.14
7.2.00.0410.00915.97
7.1.330.0150.00015.68
7.1.320.0030.00915.97
7.1.310.0070.00715.92
7.1.300.0110.00315.70
7.1.290.0070.00715.66
7.1.280.0030.01215.99
7.1.270.0060.00615.81
7.1.260.0070.00715.93
7.1.250.0310.00815.07
7.1.240.0070.00715.86
7.1.230.0040.00815.88
7.1.220.0060.00615.72
7.1.210.0070.00715.93
7.1.200.0030.01015.79
7.1.190.0030.00616.02
7.1.180.0000.01015.87
7.1.170.0030.01015.95
7.1.160.0030.01015.79
7.1.150.0030.01115.76
7.1.140.0000.01315.77
7.1.130.0060.01015.71
7.1.120.0000.01515.82
7.1.110.0040.01215.48
7.1.100.0070.00715.96
7.1.90.0000.01415.82
7.1.80.0060.00915.89
7.1.70.0060.00615.88
7.1.60.0040.01115.98
7.1.50.0060.00615.54
7.1.40.0070.01015.76
7.1.30.0100.00715.93
7.1.20.0040.01115.45
7.1.10.0000.01415.73
7.1.00.0090.00615.76

preferences:
28.09 ms | 403 KiB | 5 Q