3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fileArr = [ [ 'fileName' => 'CAR.jpg', 'processId' => 111, 'storyId' => 1 , ], [ 'fileName' => 'CAR2.jpg', 'processId' => 112, 'storyId' => 1 , ] ]; $notes = [ [ 'noteId' => 50, 'note' => 'this is a note', 'processId' => 111, ], [ 'noteId' => 50, 'note' => 'this is a note', 'processId' => 112, ], ]; function addNote(array &$array, array $notes) { $array['notes'] = []; foreach ($notes as $note) { if ($note['processId'] == $array['processId']) { $array['notes'][] = $note; } } return $array; } foreach ($fileArr as &$file) { addNote($file, $notes); } var_dump($file);

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.5.10.0100.00816.82
8.5.00.0120.00920.20
8.4.150.0030.00014.05
8.4.140.0140.00717.64
8.4.130.0140.00318.78
8.4.120.0100.00623.83
8.4.110.0110.00922.50
8.4.100.0110.01017.65
8.4.90.0120.00918.02
8.4.80.0060.00217.75
8.4.70.0030.00517.84
8.4.60.0060.00318.74
8.4.50.0130.00718.49
8.4.40.0130.00719.22
8.4.30.0050.00317.55
8.4.20.0100.01020.34
8.4.10.0130.00317.62
8.3.280.0120.00918.46
8.3.270.0070.01216.34
8.3.260.0130.00816.75
8.3.250.0120.00619.08
8.3.240.0100.01217.25
8.3.230.0130.00616.59
8.3.220.0070.01217.20
8.3.210.0120.00716.78
8.3.200.0040.00516.41
8.3.190.0100.00517.12
8.3.180.0130.00618.82
8.3.170.0150.00417.10
8.3.160.0090.00618.76
8.3.150.0130.00617.35
8.3.140.0050.00316.59
8.3.130.0060.00318.44
8.3.120.0030.00618.92
8.3.110.0090.00020.94
8.3.100.0060.00324.06
8.3.90.0080.00026.77
8.3.80.0030.00617.97
8.3.70.0190.00316.47
8.3.60.0150.00418.30
8.3.50.0090.00918.08
8.3.40.0140.00418.70
8.3.30.0040.01118.71
8.3.20.0070.00019.16
8.3.10.0070.00023.61
8.3.00.0080.00020.70
8.2.290.0100.00720.38
8.2.280.0150.00718.37
8.2.270.0060.01218.28
8.2.260.0120.00616.87
8.2.250.0040.00419.14
8.2.240.0000.00917.29
8.2.230.0080.00822.58
8.2.220.0080.00037.54
8.2.210.0080.00026.77
8.2.200.0030.00516.50
8.2.190.0120.00316.91
8.2.180.0140.00316.50
8.2.170.0120.00322.96
8.2.160.0080.00822.11
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00818.21
8.2.120.0080.00026.35
8.2.110.0060.00319.33
8.2.100.0080.00317.72
8.2.90.0050.00317.63
8.2.80.0050.00717.97
8.2.70.0080.00018.04
8.2.60.0040.00418.16
8.2.50.0040.00418.10
8.2.40.0080.00019.46
8.2.30.0030.00519.22
8.2.20.0070.00018.23
8.2.10.0040.00418.16
8.2.00.0040.00417.72
8.1.330.0100.00521.68
8.1.320.0090.00216.14
8.1.310.0100.00716.68
8.1.300.0080.00018.23
8.1.290.0000.00930.84
8.1.280.0140.00725.92
8.1.270.0030.00720.63
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0050.00519.51
8.1.230.0120.00020.97
8.1.220.0000.00917.74
8.1.210.0080.00018.77
8.1.200.0000.00917.35
8.1.190.0100.00017.00
8.1.180.0000.01018.10
8.1.170.0030.00518.64
8.1.160.0030.00318.81
8.1.150.0070.00018.82
8.1.140.0000.00722.21
8.1.130.0000.00717.36
8.1.120.0000.00717.36
8.1.110.0040.00417.49
8.1.100.0030.00517.47
8.1.90.0040.00417.43
8.1.80.0000.00717.47
8.1.70.0070.00017.35
8.1.60.0040.00417.61
8.1.50.0030.00617.46
8.1.40.0030.00517.41
8.1.30.0030.00617.60
8.1.20.0000.00817.55
8.1.10.0000.00817.49
8.1.00.0000.00817.49
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0000.00718.37
8.0.270.0070.00016.88
8.0.260.0000.00716.87
8.0.250.0030.00317.07
8.0.240.0000.00717.06
8.0.230.0040.00316.91
8.0.220.0070.00016.85
8.0.210.0000.00716.96
8.0.200.0030.00317.00
8.0.190.0000.00717.04
8.0.180.0070.00017.03
8.0.170.0000.00916.98
8.0.160.0000.00716.91
8.0.150.0040.00416.85
8.0.140.0050.00216.84
8.0.130.0030.00313.38
8.0.120.0030.00616.92
8.0.110.0040.00417.00
8.0.100.0000.00816.86
8.0.90.0000.00716.78
8.0.80.0130.00616.93
8.0.70.0070.00017.00
8.0.60.0000.00716.88
8.0.50.0020.00516.78
8.0.30.0060.01717.24
8.0.20.0130.00817.40
8.0.10.0000.00817.14
8.0.00.0070.01016.78
7.4.330.0000.00615.55
7.4.320.0030.00316.37
7.4.300.0000.00716.54
7.4.290.0070.00016.50
7.4.280.0100.00016.46
7.4.270.0040.00416.61
7.4.260.0070.00316.48
7.4.250.0040.00416.50
7.4.240.0040.00416.50
7.4.230.0040.00416.61
7.4.220.0000.00716.45
7.4.210.0020.01316.54
7.4.200.0070.00016.68
7.4.160.0090.00916.52
7.4.140.0090.00917.86
7.4.130.0180.00616.59
7.4.120.0070.00916.53
7.4.110.0130.00416.68
7.4.100.0070.01016.43
7.4.90.0100.00816.39
7.4.80.0130.00919.39
7.4.70.0130.00316.61
7.4.60.0070.01116.49
7.4.50.0070.01016.52
7.4.40.0030.01816.58
7.4.00.0080.00815.10
7.3.330.0000.00613.22
7.3.320.0060.00013.32
7.3.310.0030.00616.20
7.3.300.0000.00716.28
7.3.290.0060.00316.30
7.3.280.0050.00916.35
7.3.260.0100.01016.58
7.3.240.0120.00816.42
7.3.230.0110.00916.64
7.3.210.0090.00916.48
7.3.200.0040.01216.39
7.3.190.0140.00616.45
7.3.180.0100.00716.64
7.3.170.0140.00816.37
7.3.160.0180.00416.43
7.3.120.0060.00615.05
7.3.110.0040.01414.92
7.3.100.0060.00914.64
7.3.90.0030.01015.00
7.3.80.0000.01414.87
7.3.70.0090.00314.97
7.3.60.0030.01414.80
7.3.50.0060.00614.77
7.3.40.0040.00414.65
7.3.30.0000.01214.91
7.3.20.0090.00416.53
7.3.10.0060.01216.60
7.3.00.0050.00816.70
7.2.330.0040.01316.52
7.2.320.0120.00616.70
7.2.310.0070.01816.79
7.2.300.0100.00716.82
7.2.290.0060.01016.69
7.2.250.0140.00415.32
7.2.240.0100.00715.20
7.2.230.0000.00915.23
7.2.220.0000.01315.17
7.2.210.0060.00914.97
7.2.200.0100.00715.03
7.2.190.0060.01214.80
7.2.180.0100.00715.19
7.2.170.0090.00615.10
7.2.130.0000.01316.16
7.2.120.0150.00416.44
7.2.110.0270.00815.68
7.2.100.0320.00815.89
7.2.90.0300.00415.70
7.2.80.0260.00815.84
7.2.70.0250.00815.88
7.2.60.0310.00815.87
7.2.50.0270.00815.84
7.2.40.0230.01115.67
7.2.30.0300.00316.00
7.2.20.0440.00815.92
7.2.10.0290.00615.76
7.2.00.0330.00316.03
7.1.330.0060.00815.71
7.1.320.0030.01215.85
7.1.310.0070.00715.97
7.1.300.0060.00615.97
7.1.290.0100.00715.86
7.1.280.0070.00715.69
7.1.270.0030.01315.87
7.1.260.0070.01015.62
7.1.250.0040.00715.59
7.1.230.0560.01113.99
7.1.220.0610.00614.17
7.1.210.0510.00013.83
7.1.200.0540.01413.96
7.1.190.0580.01413.86
7.1.180.0490.00014.02
7.1.170.0350.01013.88
7.1.160.0410.00913.68
7.1.150.0630.00613.88
7.1.140.0720.00314.05
7.1.130.0700.00313.73
7.1.120.0520.00613.92
7.1.110.0530.01313.95
7.1.100.1490.00314.11
7.1.90.0440.00713.80
7.1.80.0740.00713.73
7.1.70.0470.01113.98
7.1.60.0640.01331.64
7.1.50.1320.00331.53
7.1.40.0960.00631.77
7.1.30.0900.01331.68
7.1.20.0790.01331.97
7.1.10.0720.00613.91
7.1.00.0880.00713.89
5.6.380.0040.01114.76

preferences:
40.42 ms | 403 KiB | 5 Q