3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrays = json_decode('[ { "id": 0, "title": "a title" }, { "id": 1, "title": "another title" }, { "id": 2, "title": "one more title" } ]', true); $array = [ 'id' => 1, 'title' => 'a different title', ]; foreach ($arrays as &$value) { if ($value['id'] === $array['id']) { $value = $array; } } unset($value); var_dump($arrays);

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.0160.00018.30
8.3.50.0090.00618.32
8.3.40.0110.00418.97
8.3.30.0070.01318.70
8.3.20.0080.00019.20
8.3.10.0040.00419.51
8.3.00.0090.00623.66
8.2.180.0090.00616.32
8.2.170.0060.01222.96
8.2.160.0090.00620.57
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00819.83
8.2.120.0030.00726.35
8.2.110.0090.00922.13
8.2.100.0060.00618.04
8.2.90.0000.00818.28
8.2.80.0060.00319.11
8.2.70.0060.00318.03
8.2.60.0100.00018.16
8.2.50.0000.00918.10
8.2.40.0000.00820.50
8.2.30.0040.00418.06
8.2.20.0000.00718.04
8.2.10.0000.00819.92
8.2.00.0030.00319.50
8.1.280.0030.01725.92
8.1.270.0160.00020.65
8.1.260.0080.00026.35
8.1.250.0120.00328.09
8.1.240.0030.00721.02
8.1.230.0090.00320.86
8.1.220.0030.00617.77
8.1.210.0040.00418.77
8.1.200.0060.00317.38
8.1.190.0000.00817.22
8.1.180.0050.00318.10
8.1.170.0040.00418.95
8.1.160.0020.00518.90
8.1.150.0070.00018.80
8.1.140.0050.00217.64
8.1.130.0040.00618.34
8.1.120.0050.00317.41
8.1.110.0030.00517.45
8.1.100.0060.00217.42
8.1.90.0070.00217.50
8.1.80.0070.00317.39
8.1.70.0030.00617.46
8.1.60.0060.00317.56
8.1.50.0060.00217.47
8.1.40.0030.00517.56
8.1.30.0030.00517.58
8.1.20.0040.00417.63
8.1.10.0040.00317.54
8.1.00.0030.00517.38
8.0.300.0000.00720.04
8.0.290.0000.00916.75
8.0.280.0070.00018.36
8.0.270.0000.00716.86
8.0.260.0010.00617.59
8.0.250.0030.00516.90
8.0.240.0020.00516.93
8.0.230.0020.00516.86
8.0.220.0020.00516.87
8.0.210.0020.00616.85
8.0.200.0050.00216.94
8.0.190.0020.00616.88
8.0.180.0040.00416.87
8.0.170.0050.00316.92
8.0.160.0040.00416.87
8.0.150.0030.00316.85
8.0.140.0050.00316.71
8.0.130.0020.00515.05
8.0.120.0050.00316.83
8.0.110.0000.00716.84
8.0.100.0050.00316.85
8.0.90.0060.00216.75
8.0.80.0060.01016.89
8.0.70.0020.00516.82
8.0.60.0060.00116.80
8.0.50.0060.00116.80
8.0.30.0050.01116.87
8.0.20.0080.00917.18
8.0.10.0020.00516.88
8.0.00.0100.00616.83
7.4.330.0090.00114.26
7.4.320.0070.00516.41
7.4.300.0080.00416.50
7.4.290.0090.00416.51
7.4.280.0100.00216.38
7.4.270.0060.00716.45
7.4.260.0100.00216.49
7.4.250.0060.00516.38
7.4.240.0070.00516.42
7.4.230.0080.00316.35
7.4.220.0000.01116.43
7.4.210.0120.00416.51
7.4.200.0050.00616.54
7.4.190.0150.00016.51
7.4.180.0130.00016.58
7.4.160.0060.00916.54
7.4.150.0100.00316.41
7.4.140.0090.00817.59
7.4.130.0140.00216.47
7.4.120.0100.00916.51
7.4.110.0100.00616.49
7.4.100.0080.00816.53
7.4.90.0080.00916.46
7.4.80.0090.00917.84
7.4.70.0040.01116.39
7.4.60.0090.00616.38
7.4.50.0110.00116.25
7.4.40.0080.00716.47
7.4.30.0100.00316.38
7.4.20.0080.00616.33
7.4.10.0120.00215.56
7.4.00.0100.00515.34
7.3.330.0090.00114.80
7.3.320.0080.00114.73
7.3.310.0060.00516.25
7.3.300.0080.00316.37
7.3.290.0100.00016.24
7.3.280.0070.01016.32
7.3.270.0090.00516.26
7.3.260.0130.00516.52
7.3.250.0100.00316.30
7.3.240.0100.00716.39
7.3.230.0130.00316.49
7.3.220.0100.00316.09
7.3.210.0130.00216.46
7.3.200.0130.00416.27
7.3.190.0080.00716.27
7.3.180.0060.00916.30
7.3.170.0140.00316.32
7.3.160.0090.00616.24
7.3.150.0140.00016.20
7.3.140.0120.00216.30
7.3.130.0090.00615.46
7.3.120.0100.00615.29
7.3.110.0110.00615.34
7.3.100.0040.01115.21
7.3.90.0090.00815.44
7.3.80.0060.00715.37
7.3.70.0100.00215.38
7.3.60.0050.00715.38
7.3.50.0080.00715.35
7.3.40.0090.00615.29
7.3.30.0070.00615.33
7.3.20.0080.00616.52
7.3.10.0090.00416.57
7.3.00.0090.00516.53
7.2.340.0080.00816.19
7.2.330.0100.00616.59
7.2.320.0130.00316.39
7.2.310.0080.00816.54
7.2.300.0090.00616.49
7.2.290.0050.01016.45
7.2.280.0140.00016.41
7.2.270.0100.00316.28
7.2.260.0070.00915.56
7.2.250.0070.00915.48
7.2.240.0070.00815.61
7.2.230.0040.01015.54
7.2.220.0090.00515.56
7.2.210.0060.00815.52
7.2.200.0100.00415.58
7.2.190.0050.01015.45
7.2.180.0050.00815.37
7.2.170.0080.00415.56
7.2.160.0060.00715.82
7.2.150.0100.00516.66
7.2.140.0110.00416.76
7.2.130.0120.00216.75
7.2.120.0110.00416.78
7.2.110.0110.00516.72
7.2.100.0090.00616.72
7.2.90.0080.00616.70
7.2.80.0090.00416.73
7.2.70.0120.00316.63
7.2.60.0100.00716.46
7.2.50.0090.00816.38
7.2.40.0080.00816.40
7.2.30.0120.00516.45
7.2.20.0110.00616.41
7.2.10.0120.00516.43
7.2.00.0070.00816.46
7.1.330.0080.00615.62
7.1.320.0040.01015.81
7.1.310.0100.00716.29
7.1.300.0070.00716.23
7.1.290.0090.00516.38
7.1.280.0050.00716.20
7.1.270.0080.00716.19
7.1.260.0080.00716.32
7.1.250.0100.00416.49
7.1.240.0080.00516.60
7.1.230.0060.00716.53
7.1.220.0110.00416.46
7.1.210.0050.00716.55
7.1.200.0100.00516.37
7.1.190.0040.00816.50
7.1.180.0050.00916.36
7.1.170.0070.00815.68
7.1.160.0100.00515.66
7.1.150.0060.00815.67
7.1.140.0090.00715.62
7.1.130.0090.00715.75
7.1.120.0070.00715.59
7.1.110.0120.00715.65
7.1.100.0230.00815.66
7.1.90.0090.00515.70
7.1.80.0080.00715.53
7.1.70.0080.00715.55
7.1.60.0190.01026.50
7.1.50.0220.00926.46
7.1.40.0180.00826.44
7.1.30.0200.00826.39
7.1.20.0210.00826.43
7.1.10.0100.00515.67
7.1.00.0070.00915.70
7.0.330.0080.00416.09
7.0.320.0120.00316.16
7.0.310.0080.00716.15
7.0.300.0060.00816.15
7.0.290.0080.00516.20
7.0.280.0090.00515.99
7.0.270.0070.00816.11
7.0.260.0070.00716.13
7.0.250.0070.00716.15
7.0.240.0060.00616.21
7.0.230.0070.00716.08
7.0.220.0070.00416.17
7.0.210.0070.00716.24
7.0.200.0090.00516.02
7.0.190.0100.00316.22
7.0.180.0070.00416.15
7.0.170.0080.00616.26
7.0.160.0040.01016.27
7.0.150.0080.00816.06
7.0.140.0100.00216.15
7.0.130.0100.00316.20
7.0.120.0070.00716.12
7.0.110.0050.00816.06
7.0.100.0090.00616.27
7.0.90.0110.00216.16
7.0.80.0100.00516.12
7.0.70.0100.00616.14
7.0.60.0050.00716.07
7.0.50.0100.00316.08
7.0.40.0110.00515.17
7.0.30.0100.00615.15
7.0.20.0090.00415.20
7.0.10.0060.00615.10
7.0.00.0060.00615.15
5.6.400.0050.00915.02
5.6.390.0090.00514.97
5.6.380.0070.00715.17
5.6.370.0070.00515.16
5.6.360.0090.00415.01
5.6.350.0070.00515.16
5.6.340.0070.00815.14
5.6.330.0110.00215.31
5.6.320.0090.00415.19
5.6.310.0080.00615.03
5.6.300.0080.00715.09
5.6.290.0080.00215.14
5.6.280.0080.00515.01
5.6.270.0050.00715.16
5.6.260.0060.00615.22
5.6.250.0080.00315.15
5.6.240.0100.00315.03
5.6.230.0050.00915.14
5.6.220.0090.00215.08
5.6.210.0100.00315.28
5.6.200.0090.00315.09
5.6.190.0110.00415.41
5.6.180.0050.00915.26
5.6.170.0080.00515.22
5.6.160.0080.00415.18
5.6.150.0060.00715.24
5.6.140.0090.00515.10
5.6.130.0070.00415.12
5.6.120.0120.00115.21
5.6.110.0090.00415.02
5.6.100.0040.00815.05
5.6.90.0030.01115.02
5.6.80.0090.00214.98
5.6.70.0060.00815.29
5.6.60.0100.00415.05
5.6.50.0080.00515.14
5.6.40.0090.00314.98
5.6.30.0040.00915.08
5.6.20.0100.00415.01
5.6.10.0070.00715.00
5.6.00.0070.00615.04

preferences:
48.6 ms | 400 KiB | 5 Q