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 { // It can be possible to have multiple product in the same page $productsId = array_unique($productsId); $positions = array_flip($productsId); $products = [1,4,6,7,9,10,2,3,5,8]; $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.60.0110.00716.49
8.3.50.0120.00316.56
8.3.40.0060.00918.80
8.3.30.0070.00718.71
8.3.20.0030.00621.91
8.3.10.0030.00623.65
8.3.00.0040.00419.57
8.2.180.0110.01118.26
8.2.170.0110.00722.96
8.2.160.0140.00022.29
8.2.150.0050.00324.18
8.2.140.0030.00724.66
8.2.130.0040.00420.39
8.2.120.0040.00426.35
8.2.110.0000.01020.99
8.2.100.0070.00417.84
8.2.90.0000.00817.84
8.2.80.0040.00418.22
8.2.70.0040.00417.80
8.2.60.0000.00817.63
8.2.50.0040.00418.22
8.2.40.0030.00522.19
8.2.30.0040.00419.44
8.2.20.0040.00418.14
8.2.10.0070.00017.67
8.2.00.0040.00418.13
8.1.280.0170.00325.92
8.1.270.0050.00323.96
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0100.00620.64
8.1.230.0060.00620.88
8.1.220.0040.00417.79
8.1.210.0000.00818.79
8.1.200.0000.00917.48
8.1.190.0000.01317.35
8.1.180.0000.00818.10
8.1.170.0000.00918.65
8.1.160.0040.00418.90
8.1.150.0020.00519.02
8.1.140.0040.00417.75
8.1.130.0030.00720.85
8.1.120.0000.01017.41
8.1.110.0020.00517.50
8.1.100.0000.00817.44
8.1.90.0060.00317.44
8.1.80.0050.00517.36
8.1.70.0000.00717.48
8.1.60.0000.00917.49
8.1.50.0000.00817.36
8.1.40.0050.00317.53
8.1.30.0030.00517.56
8.1.20.0040.00417.56
8.1.10.0080.00017.49
8.1.00.0000.00817.48
8.0.300.0030.00620.02
8.0.290.0040.00416.75
8.0.280.0040.00418.46
8.0.270.0070.00017.27
8.0.260.0040.00416.77
8.0.250.0040.00416.95
8.0.240.0000.00716.89
8.0.230.0030.00317.00
8.0.220.0000.00716.87
8.0.210.0000.00716.82
8.0.200.0000.00716.98
8.0.190.0070.00016.90
8.0.180.0070.00016.95
8.0.170.0040.00416.96
8.0.160.0040.00416.95
8.0.150.0000.00816.80
8.0.140.0070.00016.73
8.0.130.0030.00313.29
8.0.120.0080.00016.85
8.0.110.0050.00316.85
8.0.100.0050.00216.77
8.0.90.0040.00416.87
8.0.80.0100.01016.89
8.0.70.0040.00416.93
8.0.60.0000.00716.86
8.0.50.0000.00816.94
8.0.30.0120.00517.18
8.0.20.0070.01017.40
8.0.10.0000.00717.03
8.0.00.0120.00616.62
7.4.330.0030.00315.55
7.4.320.0060.00316.63
7.4.300.0030.00316.51
7.4.290.0070.00016.60
7.4.280.0100.00016.55
7.4.270.0030.00316.66
7.4.260.0000.00716.52
7.4.250.0030.00316.43
7.4.240.0070.00016.54
7.4.230.0030.00316.54
7.4.220.0000.00916.51
7.4.210.0080.00816.49
7.4.200.0000.00716.70
7.4.160.0090.00616.46
7.4.140.0120.00917.86
7.4.130.0060.01216.59
7.4.120.0100.01216.46
7.4.110.0130.01016.48
7.4.100.0190.00316.42
7.4.90.0120.00916.35
7.4.80.0120.00619.39
7.4.70.0170.00616.63
7.4.60.0070.00716.46
7.4.50.0070.00716.30
7.4.40.0130.00916.34
7.4.00.0070.00814.90
7.3.330.0030.00313.29
7.3.320.0070.00013.29
7.3.310.0000.00716.18
7.3.300.0000.00716.23
7.3.290.0070.00016.20
7.3.280.0080.00716.32
7.3.260.0120.00616.44
7.3.240.0110.00616.44
7.3.230.0100.00716.27
7.3.210.0090.01516.62
7.3.200.0040.01316.44
7.3.190.0080.00816.29
7.3.180.0140.00316.36
7.3.170.0130.00316.52
7.3.160.0040.01116.54
7.3.120.0070.01114.84
7.3.110.0080.00914.87
7.3.100.0060.00914.62
7.3.90.0040.01014.67
7.3.80.0050.00914.71
7.3.70.0070.00614.85
7.3.60.0060.00714.79
7.3.50.0090.00414.60
7.3.40.0060.00814.88
7.3.30.0030.00914.86
7.3.20.0050.00716.62
7.3.10.0100.00416.73
7.3.00.0090.00316.77
7.2.330.0090.00916.51
7.2.320.0070.01416.69
7.2.310.0060.01216.76
7.2.300.0060.01616.75
7.2.290.0110.01316.87
7.2.250.0040.01215.05
7.2.240.0050.01315.14
7.2.230.0050.00715.02
7.2.220.0050.00815.09
7.2.210.0060.00915.21
7.2.200.0040.00815.03
7.2.190.0040.01215.08
7.2.180.0060.00715.14
7.2.170.0060.00815.03
7.2.60.0130.00316.93
7.2.30.0110.00919.77
7.2.20.0080.01019.94
7.2.10.0080.01319.95
7.2.00.0100.01219.47
7.1.330.0060.00915.84
7.1.320.0070.00715.73
7.1.310.0060.00715.84
7.1.300.0030.01015.58
7.1.290.0060.00815.69
7.1.280.0070.00715.77
7.1.270.0070.00515.58
7.1.260.0100.00415.72
7.1.200.0040.01115.62
7.1.150.0050.01418.79
7.1.140.0060.01518.70
7.1.130.0070.01418.81
7.1.120.0080.01118.75
7.1.110.0080.01017.95
7.1.100.0070.01018.08
7.1.90.0080.00917.97
7.1.80.0080.01118.03
7.1.70.0090.00917.11
7.1.60.0300.01334.91
7.1.50.0280.01334.65
7.1.40.0210.01834.32
7.1.30.0290.01534.47
7.1.20.0270.01634.56
7.1.10.0100.01516.59
7.1.00.0060.01216.69

preferences:
66.67 ms | 400 KiB | 5 Q