3v4l.org

run code in 300+ PHP versions simultaneously
<?php $maxId = 10; $n = 4; // If there are less urls in the db then required, lower the requirements $n = $maxId < $n ? $maxId : $n; $randomIds = []; while (count($randomIds) < $n) { $randomId = rand(1, $maxId); if (!in_array($randomId, $randomIds)) { $randomIds[] = $randomId; } } var_dump($randomIds);

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)
7.4.10.0090.00915.01
7.4.00.0070.01115.05
7.3.130.0110.00714.52
7.3.120.0070.01015.06
7.3.110.0060.00914.62
7.3.100.0040.01414.90
7.3.90.0030.01014.49
7.3.80.0120.00314.93
7.3.70.0060.01014.53
7.3.60.0000.01814.88
7.3.50.0090.00614.77
7.3.40.0090.00014.74
7.3.30.0100.00614.71
7.3.20.0080.00816.45
7.3.10.0070.01016.27
7.3.00.0060.00916.71
7.2.260.0110.00715.33
7.2.250.0030.01714.96
7.2.240.0070.01114.98
7.2.230.0070.00415.14
7.2.220.0000.01414.85
7.2.210.0000.01414.86
7.2.200.0060.00915.14
7.2.190.0060.01315.15
7.2.180.0030.01014.89
7.2.170.0040.01415.06
7.2.160.0070.00715.22
7.2.150.0060.00617.05
7.2.140.0070.00717.16
7.2.130.0130.00317.00
7.2.120.0040.00816.80
7.2.110.0090.00616.81
7.2.100.0030.00616.63
7.2.90.0060.00616.87
7.2.80.0060.00317.03
7.2.70.0100.00617.01
7.2.60.0000.01116.72
7.2.50.0040.00717.07
7.2.40.0040.01217.09
7.2.30.0000.01416.82
7.2.20.0030.01017.06
7.2.10.0120.00316.80
7.2.00.0050.00718.13
7.1.330.0070.00715.68
7.1.320.0030.00615.75
7.1.310.0000.01115.96
7.1.300.0090.00315.79
7.1.290.0030.00615.77
7.1.280.0090.00615.81
7.1.270.0070.00715.83
7.1.260.0030.01315.87
7.1.250.0040.00715.61
7.1.240.0070.00715.65
7.1.230.0060.00615.81
7.1.220.0060.00915.85
7.1.210.0090.00615.82
7.1.200.0120.00015.89
7.1.190.0040.01115.96
7.1.180.0110.00415.77
7.1.170.0030.00615.59
7.1.160.0040.01215.79
7.1.150.0100.00715.70
7.1.140.0070.00715.82
7.1.130.0120.00416.02
7.1.120.0000.00815.77
7.1.110.0070.00715.94
7.1.100.0080.00616.88
7.1.90.0050.00815.97
7.1.80.0100.00616.01
7.1.70.0080.01316.43
7.1.60.0170.00925.49
7.1.50.0140.01425.48
7.1.40.0130.01425.05
7.1.30.0190.00525.04
7.1.20.0180.01425.12
7.1.10.0040.01416.13
7.1.00.0050.01016.23
7.0.330.0030.00915.36
7.0.320.0100.00715.23
7.0.310.0000.00815.60
7.0.300.0030.00715.38
7.0.290.0070.00715.37
7.0.280.0110.00315.46
7.0.270.0060.00915.26
7.0.260.0040.01115.40
7.0.250.0040.01115.44
7.0.240.0060.00915.55
7.0.230.0070.00315.42
7.0.220.0070.00715.43
7.0.210.0060.00615.54
7.0.200.0090.00716.13
7.0.190.0080.00915.84
7.0.180.0120.00715.82
7.0.170.0060.00715.83
7.0.160.0090.01015.73
7.0.150.0070.00915.70
7.0.140.0100.00915.84
7.0.130.0000.01615.86
7.0.120.0090.00815.82
7.0.110.0030.01615.88
7.0.100.0080.01215.96
7.0.90.0110.00415.73
7.0.80.0050.01215.83
7.0.70.0060.01115.73
7.0.60.0090.00815.67
7.0.50.0060.00916.03
7.0.40.0040.01214.96
7.0.30.0030.01314.99
7.0.20.0080.01014.99
7.0.10.0000.01614.97
7.0.00.0050.00814.90
5.6.400.0040.01114.40
5.6.390.0070.01013.96
5.6.380.0000.01014.01
5.6.370.0000.00814.33
5.6.360.0030.00614.27
5.6.350.0030.01514.45
5.6.340.0000.01514.62
5.6.330.0000.00814.61
5.6.320.0050.00314.07
5.6.310.0040.01114.41
5.6.300.0070.00714.66
5.6.290.0040.00814.23
5.6.280.0090.00614.46
5.6.270.0060.01214.50
5.6.260.0000.01514.11
5.6.250.0030.01314.37
5.6.240.0090.00614.21
5.6.230.0180.00014.20
5.6.220.0100.00314.35
5.6.210.0040.01114.14
5.6.200.0060.00614.20
5.6.190.0130.00014.09
5.6.180.0070.01014.30
5.6.170.0060.00914.46
5.6.160.0110.00314.33
5.6.150.0040.00714.52
5.6.140.0000.01114.31
5.6.130.0040.01114.48
5.6.120.0040.01114.27
5.6.110.0100.00314.36
5.6.100.0060.00914.29
5.6.90.0100.00614.46
5.6.80.0040.01414.18
5.6.70.0060.00914.21
5.6.60.0000.01514.43
5.6.50.0100.00314.32
5.6.40.0100.00314.14
5.6.30.0070.00714.40
5.6.20.0120.00314.14
5.6.10.0030.01214.13
5.6.00.0040.00814.20

preferences:
56.57 ms | 401 KiB | 5 Q