3v4l.org

run code in 300+ PHP versions simultaneously
<?php $answers = [ [ 'questionid' => '28f68dc4-acc6-4ab7-956d-ca41abf3a4c2', 'answer' => 'Antwoord 89', 'extra' => '', ], [ 'questionid' => '28f-28f68dc4-acc6-4ab7-956d-ca41abf3a4c20', 'answer' => 'Antwoord 20', 'extra' => 'Extra informatie 20', ], [ 'questionid' => 'd8f-28f68dc4-acc6-4ab7-956d-ca41abf3a4c20', 'answer' => 'Antwoord 3', 'extra' => '', ], ]; $questions = [ [ 'questionId' => '28f-28f68dc4-acc6-4ab7-956d-ca41abf3a4c20', 'question' => '1. Question 1', 'type' => 'typequestion/question-text-input', ], ]; $indexedQuestions = []; foreach ($questions as $question) { $id = $question['questionId']; $indexedQuestions[$id] = $question; } $combined = []; foreach ($answers as $answer) { $id = $answer['questionid']; if (isset($indexedQuestions[$id])) { $combined[] = $answer + $indexedQuestions[$id]; } else { $combined[] = $answer; } } print_r($combined);

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.130.0090.00818.90
8.4.120.0090.01024.18
8.4.110.0100.00820.66
8.4.100.0110.00818.87
8.4.90.0070.00322.51
8.4.80.0100.00918.62
8.4.70.0080.00318.68
8.4.60.0120.00818.75
8.4.50.0090.01118.52
8.4.40.0060.01319.41
8.4.30.0120.00320.20
8.4.20.0130.00617.71
8.4.10.0070.00317.64
8.3.260.0140.00616.61
8.3.250.0060.00219.18
8.3.240.0110.00917.20
8.3.230.0100.00916.27
8.3.220.0090.01018.91
8.3.210.0110.00716.52
8.3.200.0040.00416.54
8.3.190.0120.00816.61
8.3.180.0090.00918.91
8.3.170.0090.01020.75
8.3.160.0090.00918.29
8.3.150.0070.01417.30
8.3.140.0040.00418.41
8.3.130.0000.00818.19
8.3.120.0030.00620.80
8.3.110.0090.00620.94
8.3.100.0090.00624.06
8.3.90.0170.00326.77
8.3.80.0060.00319.36
8.3.70.0070.00716.58
8.3.60.0070.00716.63
8.3.50.0110.00617.18
8.3.40.0140.00718.69
8.3.30.0060.00818.71
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0100.00820.29
8.2.280.0140.00520.34
8.2.270.0120.00617.05
8.2.260.0120.00616.33
8.2.250.0080.00018.41
8.2.240.0040.00417.19
8.2.230.0110.00022.58
8.2.220.0040.01837.54
8.2.210.0110.00426.77
8.2.200.0050.00518.88
8.2.190.0140.00018.32
8.2.180.0140.00725.92
8.2.170.0040.01118.91
8.2.160.0140.00022.96
8.2.150.0000.00725.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0000.00826.35
8.2.110.0100.00020.47
8.2.100.0040.00817.91
8.2.90.0000.00817.97
8.2.80.0000.00817.97
8.2.70.0060.00317.75
8.2.60.0050.00218.05
8.2.50.0060.00318.07
8.2.40.0040.00418.28
8.2.30.0040.00418.00
8.2.20.0070.00018.03
8.2.10.0040.00419.18
8.2.00.0080.00019.25
8.1.330.0070.01122.02
8.1.320.0110.00916.18
8.1.310.0040.00418.59
8.1.300.0040.00416.08
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0000.00923.90
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0000.00922.59
8.1.230.0040.00722.82
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.23
8.1.180.0050.00318.10
8.1.170.0030.00718.49
8.1.160.0000.00818.93
8.1.150.0050.00218.88
8.1.140.0000.00818.76
8.1.130.0000.00717.50
8.1.120.0050.00317.36
8.1.110.0070.00017.49
8.1.100.0000.00717.45
8.1.90.0040.00417.44
8.1.80.0040.00517.44
8.1.70.0000.00717.41
8.1.60.0070.00017.53
8.1.50.0000.00817.44
8.1.40.0050.00317.47
8.1.30.0040.00417.61
8.1.20.0070.00017.60
8.1.10.0000.00717.47
8.1.00.0040.00417.44
8.0.300.0040.00419.94
8.0.290.0030.00516.75
8.0.280.0000.00920.21
8.0.270.0000.00718.06
8.0.260.0030.00316.78
8.0.250.0050.00317.04
8.0.240.0040.00417.01
8.0.230.0040.00416.87
8.0.220.0030.00316.93
8.0.210.0030.00316.97
8.0.200.0000.00716.94
8.0.190.0000.00717.02
8.0.180.0040.00416.89
8.0.170.0040.00416.94
8.0.160.0120.00016.91
8.0.150.0000.00716.89
8.0.140.0040.00416.86
8.0.130.0000.00613.36
8.0.120.0030.00616.93
8.0.110.0070.00016.83
8.0.100.0030.00616.77
8.0.90.0000.00816.96
8.0.80.0100.00516.87
8.0.70.0000.00716.91
8.0.60.0040.00416.84
8.0.50.0040.00416.83
8.0.30.0080.01316.93
8.0.20.0090.00917.18
8.0.10.0070.01017.09
8.0.00.0140.00516.85
7.4.330.0020.00215.55
7.4.320.0000.00616.42
7.4.300.0060.00016.61
7.4.290.0000.00816.53
7.4.280.0070.00016.41
7.4.270.0000.00716.60
7.4.260.0050.00013.34
7.4.250.0030.00316.46
7.4.240.0020.00516.53
7.4.230.0030.00516.58
7.4.220.0040.00416.42
7.4.210.0120.00516.53
7.4.200.0030.00316.52
7.4.160.0100.00716.36
7.4.150.0030.01216.71
7.4.140.0060.01116.16
7.4.130.0120.00416.30
7.4.120.0120.00416.04
7.4.110.0030.01316.22
7.4.100.0080.00816.36
7.4.90.0080.00816.23
7.4.80.0030.01216.18
7.4.70.0100.01016.08
7.4.60.0030.01716.11
7.4.50.0000.01816.09
7.4.40.0040.01516.36
7.4.30.0090.00916.54
7.4.20.0110.00516.50
7.4.10.0120.00316.50
7.4.00.0130.00316.25
7.3.330.0070.00016.20
7.3.320.0060.00013.16
7.3.310.0050.00216.46
7.3.300.0000.00716.36
7.3.290.0090.00616.33
7.3.270.0000.01716.68
7.3.260.0110.00616.35
7.3.250.0080.00815.98
7.3.240.0090.01316.33
7.3.230.0040.01116.04
7.3.220.0040.01216.10
7.3.210.0060.01116.25
7.3.200.0110.00815.98
7.3.190.0050.01016.14
7.3.180.0100.01016.02
7.3.170.0080.01216.21
7.3.160.0050.01116.43
7.3.150.0060.00916.48
7.3.140.0070.00716.34
7.3.130.0060.00916.46
7.3.120.0150.00016.50
7.3.110.0070.00716.27
7.3.100.0120.00316.44
7.3.90.0080.00816.34
7.3.80.0080.00616.22
7.3.70.0110.00416.46
7.3.60.0000.01616.24
7.3.50.0120.00416.48
7.3.40.0090.00616.62
7.3.30.0040.01116.41
7.3.20.0000.01616.38
7.3.10.0070.01016.43
7.3.00.0080.00816.29

preferences:
29.26 ms | 403 KiB | 5 Q