3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cart_array = Session::get('products-cart'); $newProduct = ['id' => $request->product_id, 'qty' => $request->product_qty]; foreach($cart_array as &$item) { if ($item['id'] == $newProduct['id']) { $item = $newProduct; } } dd($cart_array);

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.86
8.5.00.0130.00820.26
8.4.160.0150.00923.80
8.4.150.0030.00014.05
8.4.140.0130.00817.71
8.4.130.0110.00617.62
8.4.120.0120.00720.36
8.4.110.0060.00222.54
8.4.100.0140.00718.05
8.4.90.0120.00817.69
8.4.80.0030.00518.02
8.4.70.0080.00517.99
8.4.60.0110.00518.60
8.4.50.0060.00317.99
8.4.40.0100.00719.72
8.4.30.0120.00620.56
8.4.20.0130.00717.89
8.4.10.0000.00919.74
8.3.280.0070.01418.54
8.3.270.0080.01016.54
8.3.260.0130.00616.74
8.3.250.0110.00718.82
8.3.240.0080.01116.75
8.3.230.0040.00416.64
8.3.220.0050.00417.01
8.3.210.0080.00616.65
8.3.200.0060.00316.86
8.3.190.0120.00616.98
8.3.180.0100.00617.13
8.3.170.0070.00716.46
8.3.160.0070.01116.48
8.3.150.0140.00719.11
8.3.140.0100.00016.50
8.3.130.0050.00318.36
8.3.120.0130.00720.89
8.3.110.0100.00020.94
8.3.100.0030.00716.58
8.3.90.0070.01126.77
8.3.80.0060.00319.36
8.3.70.0170.00316.75
8.3.60.0100.01018.56
8.3.50.0130.00517.29
8.3.40.0090.00618.85
8.3.30.0040.01118.70
8.3.20.0080.00024.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.290.0040.00422.39
8.2.280.0150.00418.58
8.2.270.0100.01017.30
8.2.260.0140.00419.04
8.2.250.0080.00016.71
8.2.240.0080.00817.29
8.2.230.0070.00322.58
8.2.220.0080.00024.06
8.2.210.0080.00026.77
8.2.200.0050.00518.88
8.2.190.0140.00718.41
8.2.180.0150.00025.92
8.2.170.0070.00718.96
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0140.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00626.35
8.2.110.0060.00320.38
8.2.100.0040.00717.91
8.2.90.0040.00417.75
8.2.80.0040.00418.64
8.2.70.0030.00617.63
8.2.60.0000.00818.04
8.2.50.0040.00418.05
8.2.40.0040.00418.09
8.2.30.0000.00718.07
8.2.20.0040.00418.06
8.2.10.0040.00419.14
8.2.00.0070.00019.26
8.1.330.0110.00718.17
8.1.320.0020.00716.00
8.1.310.0030.00516.86
8.1.300.0030.01217.82
8.1.290.0060.00330.84
8.1.280.0070.01125.92
8.1.270.0040.00423.99
8.1.260.0080.00028.09
8.1.250.0070.00028.09
8.1.240.0070.00318.94
8.1.230.0110.00017.70
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0070.00317.22
8.1.190.0040.00417.23
8.1.180.0000.00918.10
8.1.170.0060.00318.66
8.1.160.0070.00018.70
8.1.150.0030.00618.82
8.1.140.0080.00018.74
8.1.130.0000.00720.05
8.1.120.0000.00717.36
8.1.110.0000.00717.30
8.1.100.0000.00817.23
8.1.90.0040.00417.30
8.1.80.0040.00417.34
8.1.70.0070.00017.31
8.1.60.0030.00517.49
8.1.50.0030.00617.53
8.1.40.0070.00417.35
8.1.30.0070.00017.62
8.1.20.0040.00417.59
8.1.10.0040.00417.50
8.1.00.0070.00017.43
8.0.300.0030.00618.77
8.0.290.0030.00616.75
8.0.280.0030.00318.32
8.0.270.0030.00517.98
8.0.260.0050.00220.16
8.0.250.0040.00417.00
8.0.240.0000.00716.98
8.0.230.0040.00416.98
8.0.220.0000.00716.92
8.0.210.0030.00316.91
8.0.200.0040.00416.90
8.0.190.0000.00716.86
8.0.180.0030.00516.80
8.0.170.0040.00716.93
8.0.160.0000.00716.77
8.0.150.0040.00416.88
8.0.140.0040.00416.91
8.0.130.0050.00013.31
8.0.120.0000.00716.83
8.0.110.0000.00716.79
8.0.100.0000.00816.97
8.0.90.0070.00016.93
8.0.80.0090.00916.85
8.0.70.0050.00316.77
8.0.60.0040.00416.80
8.0.50.0000.00716.89
8.0.30.0130.00517.05
8.0.20.0130.00317.04
8.0.10.0030.01417.12
8.0.00.0140.00317.08
7.4.330.0040.00015.55
7.4.320.0060.00016.41
7.4.300.0070.00016.43
7.4.290.0030.00516.49
7.4.280.0070.00416.55
7.4.270.0030.00316.38
7.4.260.0030.00513.17
7.4.250.0070.00016.51
7.4.240.0030.00316.48
7.4.230.0030.00316.25
7.4.220.0000.00716.53
7.4.210.0080.00816.55
7.4.200.0000.00716.57
7.4.160.0040.01216.45
7.4.150.0090.00616.37
7.4.140.0080.00816.31
7.4.130.0080.00816.39
7.4.120.0040.01116.46
7.4.110.0070.01416.49
7.4.100.0130.00916.43
7.4.90.0030.01716.35
7.4.80.0080.00816.34
7.4.70.0070.01016.50
7.4.60.0000.01516.36
7.4.50.0030.01416.52
7.4.40.0130.00416.67
7.4.30.0030.01416.59
7.4.20.0050.01016.48
7.4.10.0130.00316.52
7.4.00.0070.01016.14
7.3.330.0110.00016.15
7.3.320.0000.00513.10
7.3.310.0040.00416.11
7.3.300.0050.00316.16
7.3.290.0090.00716.26
7.3.270.0090.00616.27
7.3.260.0100.00516.41
7.3.250.0090.00616.51
7.3.240.0040.01216.24
7.3.230.0060.01616.22
7.3.220.0110.00516.62
7.3.210.0080.01216.23
7.3.200.0070.00716.34
7.3.190.0130.00316.41
7.3.180.0040.01216.21
7.3.170.0100.00616.28
7.3.160.0060.01116.21
7.3.150.0060.01016.30
7.3.140.0040.01216.41
7.3.130.0140.00316.54
7.3.120.0030.01316.42
7.3.110.0000.01716.23
7.3.100.0080.00816.24
7.3.90.0080.00816.19
7.3.80.0130.00516.38
7.3.70.0110.01116.38
7.3.60.0040.01616.29
7.3.50.0050.01116.41
7.3.40.0080.00816.43
7.3.30.0080.00816.21
7.3.20.0250.00616.48
7.3.10.0090.00616.17
7.3.00.0070.01016.22

preferences:
50.38 ms | 403 KiB | 5 Q