3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ids = [1,2,3,4,5,6,7,8,9,10]; function createMultipleFromArticles($productsId): array { $randomIds = [1,4,6,7,9,10,2,3,5,8]; // It can be possible to have multiple product in the same page $productsId = array_unique($productsId); $positions = array_flip($productsId); $products = $randomIds; $products = array_combine($productsId, $products); var_export($products); return array_map(function (int $productId) use ($products, $positions) { return [$products[$productId], $positions[$productId] + 1]; // return $this->create($products[$productId], $positions[$productId] + 1); }, $productsId); } var_export(createMultipleFromArticles($ids));

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.0120.00618.51
8.3.60.0160.00318.55
8.3.50.0030.01016.29
8.3.40.0130.01018.71
8.3.30.0110.00418.67
8.3.20.0000.00721.70
8.3.10.0080.00023.83
8.3.00.0040.00417.93
8.2.190.0070.00718.30
8.2.180.0110.00716.88
8.2.170.0090.00622.96
8.2.160.0040.01119.31
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00420.94
8.2.110.0100.00020.98
8.2.100.0060.00617.91
8.2.90.0060.00317.84
8.2.80.0000.00818.21
8.2.70.0080.00017.80
8.2.60.0060.00317.50
8.2.50.0050.00318.10
8.2.40.0000.00722.38
8.2.30.0020.00519.50
8.2.20.0070.00018.14
8.2.10.0000.00817.63
8.2.00.0030.00518.18
8.1.280.0040.01125.92
8.1.270.0000.00823.96
8.1.260.0040.01126.35
8.1.250.0040.00428.09
8.1.240.0100.00022.56
8.1.230.0090.00320.84
8.1.220.0030.00517.77
8.1.210.0030.00718.77
8.1.200.0030.00517.23
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0030.00619.02
8.1.160.0070.00018.96
8.1.150.0070.00020.29
8.1.140.0040.00417.77
8.1.130.0030.00618.96
8.1.120.0070.00017.37
8.1.110.0000.00717.45
8.1.100.0030.00717.36
8.1.90.0040.00417.30
8.1.80.0030.00517.46
8.1.70.0070.00017.48
8.1.60.0040.00417.57
8.1.50.0030.00517.54
8.1.40.0030.00617.39
8.1.30.0050.00317.55
8.1.20.0000.01117.63
8.1.10.0000.00717.50
8.1.00.0070.00017.60
8.0.300.0020.00519.91
8.0.290.0040.00416.75
8.0.280.0040.00418.41
8.0.270.0030.00317.17
8.0.260.0030.00316.87
8.0.250.0040.00416.93
8.0.240.0000.00916.83
8.0.230.0030.00316.93
8.0.220.0000.00716.87
8.0.210.0020.00516.80
8.0.200.0030.00316.96
8.0.190.0030.00616.96
8.0.180.0050.00316.89
8.0.170.0040.00416.78
8.0.160.0030.00316.96
8.0.150.0000.00716.83
8.0.140.0000.00716.92
8.0.130.0060.00013.32
8.0.120.0000.00716.84
8.0.110.0000.00916.91
8.0.100.0000.00716.91
8.0.90.0000.00716.90
8.0.80.0030.01216.88
8.0.70.0040.00416.89
8.0.60.0060.00316.86
8.0.50.0080.00016.79
8.0.30.0120.00717.20
8.0.20.0110.01417.40
8.0.10.0000.00717.04
8.0.00.0100.01016.66
7.4.330.0060.00015.55
7.4.320.0030.00316.62
7.4.300.0000.00616.56
7.4.290.0000.00816.49
7.4.280.0050.00316.55
7.4.270.0000.00716.41
7.4.260.0070.00016.57
7.4.250.0040.00416.43
7.4.240.0070.00016.52
7.4.230.0070.00016.50
7.4.220.0040.00316.51
7.4.210.0090.00716.55
7.4.200.0000.00716.70
7.4.160.0070.00916.44
7.4.140.0070.01017.86
7.4.130.0190.00616.61
7.4.120.0080.01316.52
7.4.110.0090.00916.42
7.4.100.0100.00716.47
7.4.90.0040.01416.63
7.4.80.0130.00619.39
7.4.70.0090.00916.50
7.4.60.0150.00916.74
7.4.50.0030.01016.29
7.4.40.0070.01116.71
7.4.00.0030.01315.14
7.3.330.0030.00313.45
7.3.320.0000.00713.37
7.3.310.0060.00316.35
7.3.300.0000.00716.41
7.3.290.0030.00316.39
7.3.280.0080.00716.33
7.3.260.0080.01216.36
7.3.240.0070.00916.58
7.3.230.0180.00016.58
7.3.210.0070.01016.54
7.3.200.0060.01016.53
7.3.190.0130.00316.36
7.3.180.0060.01016.27
7.3.170.0070.01016.36
7.3.160.0060.00916.50
7.2.330.0090.00916.76
7.2.320.0070.01816.51
7.2.310.0090.01416.47
7.2.300.0060.00916.43
7.2.290.0100.01016.82
7.2.60.0130.00017.04
7.2.30.0120.00917.96
7.2.20.0240.01218.10
7.2.10.0150.01118.14
7.2.00.0130.00718.06
7.1.200.0000.01215.71
7.1.150.0130.00716.73
7.1.140.0090.01616.64
7.1.130.0070.01116.56
7.1.120.0070.01116.99
7.1.110.0080.00816.43
7.1.100.0070.01115.67
7.1.90.0120.00716.13
7.1.80.0070.01316.23
7.1.70.0100.00815.56
7.1.60.0280.01033.25
7.1.50.0360.01532.95
7.1.40.0310.01832.68
7.1.30.0270.01332.59
7.1.20.0250.01432.54
7.1.10.0080.01415.01
7.1.00.0120.00815.00

preferences:
38.42 ms | 401 KiB | 5 Q