3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cart_items = '[ {"id":8, "cart_id":7, "product_id":4, "variation_id":null, "quantity":1, "price":30, "tax":0, "attrs":null, "gross_total":30, "net_total":30, "tax_total":0, "product":{ "id":4, "parent_id":null, "category_id":1, "shop_id":1, "title":"Ladies Blazer", "unit":"item", "sale_price":30, "general_price":35 } }, { "id":9, "cart_id":7, "product_id":1, "variation_id":null, "quantity":2, "price":11, "tax":0, "attrs":null, "gross_total":22, "net_total":22, "tax_total":0, "product":{ "id":1, "parent_id":null, "category_id":2, "shop_id":2, "title":"Sport Bottles", "unit":"item", "sale_price":11, "general_price":9 } } ]'; $arr = json_decode($cart_items, true); $shop_id = 1; $result = array_filter($arr, fn($v) => $v["product"]["shop_id"] == $shop_id); 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.3.70.0070.00716.63
8.3.60.0090.00616.63
8.3.50.0120.00620.21
8.3.40.0110.00420.29
8.3.30.0140.00318.70
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0050.00326.16
8.2.190.0080.00816.58
8.2.180.0070.01125.92
8.2.170.0120.00318.96
8.2.160.0120.00322.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00021.07
8.2.110.0100.00020.92
8.2.100.0000.01117.84
8.2.90.0030.00619.52
8.2.80.0030.00520.41
8.2.70.0040.00417.63
8.2.60.0020.01017.95
8.2.50.0040.00418.10
8.2.40.0050.00319.48
8.2.30.0000.00718.23
8.2.20.0050.00220.64
8.2.10.0050.00218.19
8.2.00.0000.00819.21
8.1.280.0100.00725.92
8.1.270.0030.00620.48
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0070.00322.05
8.1.230.0090.00321.04
8.1.220.0080.00017.91
8.1.210.0090.00018.91
8.1.200.0000.00817.35
8.1.190.0030.00617.25
8.1.180.0040.00418.10
8.1.170.0090.00018.66
8.1.160.0000.00818.97
8.1.150.0060.00318.57
8.1.140.0040.00417.39
8.1.130.0000.00717.34
8.1.120.0040.00818.69
8.1.110.0060.00518.64
8.1.100.0090.00318.62
8.1.90.0030.00618.59
8.1.80.0040.00418.64
8.1.70.0000.00818.59
8.1.60.0040.00818.77
8.1.50.0130.00418.70
8.1.40.0120.00618.80
8.1.30.0140.00518.93
8.1.20.0150.00318.85
8.1.10.0150.00318.72
8.1.00.0130.00518.73
8.0.300.0040.00420.09
8.0.290.0040.00416.63
8.0.280.0000.00718.36
8.0.270.0030.00317.90
8.0.260.0000.00616.71
8.0.250.0120.00418.05
8.0.240.0140.00217.99
8.0.230.0100.00318.08
8.0.220.0090.00518.01
8.0.210.0100.00517.97
8.0.200.0140.00017.98
8.0.190.0140.00018.08
8.0.180.0070.00718.00
8.0.170.0120.00218.11
8.0.160.0100.00518.13
8.0.150.0080.00618.02
8.0.140.0140.00017.99
8.0.130.0100.00318.06
8.0.120.0110.00418.02
8.0.110.0110.00217.96
8.0.100.0100.00418.02
8.0.90.0120.00217.97
8.0.80.0090.00517.89
8.0.70.0090.00617.93
8.0.60.0120.00417.88
8.0.50.0120.00417.83
8.0.30.0140.00418.02
8.0.20.0110.00618.08
8.0.10.0090.00518.05
7.4.330.0000.00513.98
7.4.320.0090.00417.66
7.4.300.0060.00617.64
7.4.290.0040.00817.63
7.4.280.0150.00017.54
7.4.270.0030.00717.43
7.4.260.0120.00317.65
7.4.250.0080.00817.59
7.4.240.0080.00817.73
7.4.230.0090.00917.58
7.4.220.0090.00617.70
7.4.210.0090.00417.55
7.4.200.0090.00617.55
7.4.190.0070.00417.69
7.4.180.0110.00417.78
7.4.160.0080.00817.79
7.4.150.0100.00717.58
7.4.140.0080.00817.45
7.4.130.0090.00617.60
7.4.120.0110.00617.59
7.4.110.0040.01217.66
7.4.100.0070.00717.67
7.4.90.0080.00817.61
7.4.80.0130.00517.52
7.4.70.0110.00617.50
7.4.60.0150.00017.44
7.4.50.0070.00717.54
7.4.40.0080.00817.50
7.4.30.0080.00817.48
7.4.20.0080.00817.65
7.4.10.0110.00517.53
7.4.00.0090.00017.60

preferences:
17.69 ms | 401 KiB | 5 Q