3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('TEST_VALUE_COUNT', 10); srand(15); $values = array(); for ($i = 0; $i < TEST_VALUE_COUNT; $i++) { $values[] = rand(); } srand(15); foreach($values as $key => $value) { if ($value !== rand()) { print "Bad value at " . $key; exit; } } echo "All were the same in " . count($values) . " values"; srand(15); shuffle($values); var_dump($values); $valuesShuffled = array_merge(array(), $values); srand(15); shuffle($values); var_dump($valuesShuffled); var_dump($values); if (count(array_diff_assoc($values, $valuesShuffled)) == 0) { echo "Array was the same after a seeded shuffle"; } else { echo "Array was not the same after a seeded shuffle\n"; }

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.3.10.0100.00516.55
7.3.00.0040.00816.48
7.2.130.0060.00316.96
7.2.120.0030.00917.05
7.2.110.0100.00016.88
7.2.100.0100.00717.01
7.2.90.0040.00717.01
7.2.80.0090.00616.59
7.2.70.0070.01016.77
7.2.60.0000.01216.73
7.2.50.0070.00317.16
7.2.40.0110.00417.10
7.2.30.0060.00317.05
7.2.20.0060.00916.91
7.2.10.0070.00716.83
7.2.00.0060.00818.32
7.1.250.0070.00715.96
7.1.70.0030.00617.17
7.1.60.0140.01119.70
7.1.50.0100.01616.97
7.1.00.0070.07322.26
7.0.200.0090.00316.68
7.0.140.0070.06722.09
7.0.100.0070.08020.04
7.0.90.0030.08319.92
7.0.80.0030.06319.95
7.0.70.0070.08019.91
7.0.60.0030.07319.96
7.0.50.0030.05020.18
7.0.40.0030.04320.10
7.0.30.0000.04720.15
7.0.20.0030.04320.14
7.0.10.0100.07720.11
7.0.00.0030.04320.13
5.6.280.0070.07021.07
5.6.250.0030.08720.57
5.6.240.0030.08320.58
5.6.230.0070.08320.70
5.6.220.0170.07020.63
5.6.210.0130.08020.65
5.6.200.0070.07720.90
5.6.190.0070.04020.96
5.6.180.0000.06721.11
5.6.170.0030.04021.10
5.6.160.0030.04021.08
5.6.150.0070.08021.04
5.6.140.0030.08321.09
5.6.130.0070.07321.12
5.6.120.0000.04321.18
5.6.110.0170.07321.08
5.6.100.0070.08721.05
5.6.90.0100.06321.08
5.6.80.0000.04320.41
5.6.70.0070.04320.43
5.6.60.0100.04720.46
5.6.50.0070.03720.38
5.6.40.0030.04020.45
5.6.30.0030.04020.47
5.6.20.0000.04020.47
5.6.10.0000.04320.48
5.6.00.0000.04720.37
5.5.380.0070.08320.35
5.5.370.0130.08020.36
5.5.360.0100.08020.51
5.5.350.0000.09020.45
5.5.340.0100.04020.78
5.5.330.0000.04320.84
5.5.320.0070.04320.75
5.5.310.0030.04020.84
5.5.300.0070.03720.91
5.5.290.0070.04320.64
5.5.280.0100.08320.64
5.5.270.0000.05320.90
5.5.260.0030.04320.76
5.5.250.0100.05020.59
5.5.240.0000.06320.23
5.5.230.0070.05020.25
5.5.220.0000.04020.14
5.5.210.0000.04720.30
5.5.200.0070.04320.29
5.5.190.0070.05020.23
5.5.180.0130.05320.24
5.5.160.0000.04320.27
5.5.150.0070.03720.18
5.5.140.0130.02720.28
5.5.130.0070.04020.18
5.5.120.0030.04320.04
5.5.110.0100.03720.08
5.5.100.0100.05320.17
5.5.90.0000.04020.08
5.5.80.0000.04320.13
5.5.70.0030.06020.11
5.5.60.0030.04320.13
5.5.50.0170.06719.97
5.5.40.0030.08020.16
5.5.30.0070.07720.11
5.5.20.0030.05020.08
5.5.10.0070.07020.04
5.5.00.0100.07320.04
5.4.450.0100.03319.22
5.4.440.0070.04019.27
5.4.430.0030.03719.44
5.4.420.0030.04019.29
5.4.410.0100.06019.01
5.4.400.0000.04018.81
5.4.390.0100.05319.08
5.4.380.0070.05718.83
5.4.370.0030.04319.04
5.4.360.0030.05018.79
5.4.350.0070.04319.22
5.4.340.0030.03719.12
5.4.320.0070.03318.89
5.4.310.0030.03719.22
5.4.300.0000.04018.95
5.4.290.0030.03719.12
5.4.280.0000.04019.04
5.4.270.0000.04719.06
5.4.260.0000.06718.96
5.4.250.0030.04319.14
5.4.240.0030.04018.80
5.4.230.0000.04018.88
5.4.220.0000.05318.96
5.4.210.0130.02719.12
5.4.200.0000.04019.12
5.4.190.0070.07719.18
5.4.180.0070.08018.77
5.4.170.0030.04718.80
5.4.160.0030.05019.04
5.4.150.0170.06319.04
5.4.140.0100.04016.31
5.4.130.0100.06716.26
5.4.120.0130.06016.33
5.4.110.0130.06716.40
5.4.100.0100.07316.36
5.4.90.0130.06716.26
5.4.80.0100.04016.25
5.4.70.0000.07716.25
5.4.60.0070.05316.25
5.4.50.0030.07716.38
5.4.40.0030.06716.33
5.4.30.0070.07316.20
5.4.20.0030.04316.36
5.4.10.0170.02316.30
5.4.00.0070.06715.80
5.3.290.0070.03714.68
5.3.280.0100.03714.55
5.3.270.0000.07714.62
5.3.260.0070.07314.63
5.3.250.0030.07314.56
5.3.240.0130.07014.57
5.3.230.0130.03714.48
5.3.220.0100.07014.45
5.3.210.0070.07314.49
5.3.200.0030.07714.57
5.3.190.0100.07014.56
5.3.180.0130.06714.57
5.3.170.0100.07014.42
5.3.160.0030.07314.58
5.3.150.0070.07714.51
5.3.140.0170.06014.52
5.3.130.0000.08314.51
5.3.120.0070.05714.52
5.3.110.0130.05314.52
5.3.100.0030.07014.19
5.3.90.0130.06314.19
5.3.80.0070.07014.19
5.3.70.0100.06714.19
5.3.60.0130.06014.19
5.3.50.0030.05314.19
5.3.40.0070.07014.19
5.3.30.0070.06314.19
5.3.20.0070.07314.19
5.3.10.0070.07314.19
5.3.00.0070.07314.19
5.2.170.0100.05714.19
5.2.160.0100.06014.19
5.2.150.0100.05714.19
5.2.140.0070.05314.19
5.2.130.0100.05014.19
5.2.120.0000.06014.19
5.2.110.0100.05714.19
5.2.100.0000.05314.19
5.2.90.0070.05714.19
5.2.80.0030.05714.19
5.2.70.0030.06714.19
5.2.60.0030.06314.19
5.2.50.0030.04314.19
5.2.40.0000.05314.19
5.2.30.0070.04714.19
5.2.20.0100.05714.19
5.2.10.0130.04714.19
5.2.00.0100.05314.19
5.1.60.0100.04714.19
5.1.50.0100.05014.19
5.1.40.0030.05014.19
5.1.30.0000.05014.19
5.1.20.0000.06014.19
5.1.10.0000.06014.19
5.1.00.0100.04714.19
5.0.50.0070.03714.19
5.0.40.0030.04314.19
5.0.30.0000.05714.19
5.0.20.0000.04014.19
5.0.10.0030.04714.19
5.0.00.0030.05714.19
4.4.90.0030.03314.19
4.4.80.0070.03314.19
4.4.70.0070.03314.19
4.4.60.0000.04014.19
4.4.50.0000.03314.19
4.4.40.0000.04714.19
4.4.30.0070.03314.19
4.4.20.0000.02014.19
4.4.10.0070.03314.19
4.4.00.0030.05014.19
4.3.110.0000.03014.19
4.3.100.0130.02714.19
4.3.90.0000.02314.19
4.3.80.0000.05714.19
4.3.70.0030.03314.19
4.3.60.0030.03314.19
4.3.50.0030.03714.19
4.3.40.0000.05314.19
4.3.30.0070.03014.19
4.3.20.0000.03714.19
4.3.10.0000.03014.19
4.3.00.0000.03714.19

preferences:
39.35 ms | 401 KiB | 5 Q