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\n"; srand(15); shuffle($values); $valuesShuffled = $values; var_dump($valuesShuffled); srand(15); shuffle($values); 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.2.00.0000.01119.52
7.1.70.0030.00617.11
7.1.60.0110.01419.21
7.1.50.0070.01416.96
7.1.00.0070.06322.36
7.0.200.0050.00316.42
7.0.140.0070.07022.00
7.0.100.0130.04719.94
7.0.90.0270.06319.94
7.0.80.0300.07319.92
7.0.70.0170.07019.84
7.0.60.0200.07019.98
7.0.50.0230.04720.25
7.0.40.0070.08720.14
7.0.30.0130.08020.15
7.0.20.0000.07720.00
7.0.10.0100.08019.91
7.0.00.0070.08020.14
5.6.280.0030.07321.11
5.6.250.0030.09320.56
5.6.240.0170.07720.63
5.6.230.0100.07020.61
5.6.220.0030.07020.55
5.6.210.0130.07720.63
5.6.200.0170.07720.93
5.6.190.0070.07321.05
5.6.180.0030.06021.04
5.6.170.0130.04021.10
5.6.160.0070.06021.10
5.6.150.0000.08721.10
5.6.140.0030.09021.02
5.6.130.0100.04720.93
5.6.120.0100.07021.04
5.6.110.0130.08021.06
5.6.100.0130.07721.02
5.6.90.0130.07320.93
5.6.80.0170.08720.39
5.6.70.0000.08020.33
5.6.60.0070.07320.54
5.6.50.0070.07320.31
5.6.40.0070.08320.53
5.6.30.0030.05720.31
5.6.20.0070.07020.36
5.6.10.0030.07720.36
5.6.00.0100.06720.30
5.5.380.0130.06720.36
5.5.370.0000.05320.56
5.5.360.0100.07720.34
5.5.350.0100.05020.34
5.5.340.0100.08320.80
5.5.330.0130.08320.88
5.5.320.0030.06320.90
5.5.310.0030.08320.63
5.5.300.0100.07720.64
5.5.290.0130.06720.76
5.5.280.0030.06720.91
5.5.270.0130.07720.86
5.5.260.0070.04720.91
5.5.250.0100.08720.60
5.5.240.0100.07720.31
5.5.230.0070.08020.12
5.5.220.0130.07720.14
5.5.210.0030.08020.27
5.5.200.0000.07320.12
5.5.190.0170.06720.21
5.5.180.0170.06719.99
5.5.160.0100.04320.07
5.5.150.0070.07020.25
5.5.140.0070.08720.18
5.5.130.0100.03720.23
5.5.120.0030.06720.07
5.5.110.0100.04320.22
5.5.100.0100.06020.01
5.5.90.0070.08020.00
5.5.80.0070.08320.06
5.5.70.0100.08019.91
5.5.60.0070.03720.08
5.5.50.0130.03320.04
5.5.40.0030.08020.13
5.5.30.0070.06020.14
5.5.20.0000.07020.07
5.5.10.0030.05720.07
5.5.00.0170.05319.98
5.4.450.0170.07319.55
5.4.440.0130.07719.55
5.4.430.0130.07719.32
5.4.420.0070.06019.44
5.4.410.0100.05719.32
5.4.400.0200.06319.10
5.4.390.0130.07018.80
5.4.380.0070.08319.10
5.4.370.0130.05019.14
5.4.360.0100.06719.03
5.4.350.0070.05018.98
5.4.340.0130.04019.13
5.4.320.0100.07319.03
5.4.310.0100.07718.95
5.4.300.0100.05318.80
5.4.290.0030.08319.02
5.4.280.0130.07319.14
5.4.270.0100.07319.12
5.4.260.0100.04018.98
5.4.250.0100.07018.95
5.4.240.0070.03319.02
5.4.230.0170.07019.02
5.4.220.0030.07019.05
5.4.210.0030.06318.95
5.4.200.0070.07318.80
5.4.190.0070.07718.97
5.4.180.0070.06719.04
5.4.170.0100.03719.09
5.4.160.0100.07719.05
5.4.150.0170.06718.79
5.4.140.0100.07016.36
5.4.130.0100.04716.34
5.4.120.0130.06016.26
5.4.110.0070.04016.23
5.4.100.0170.06716.43
5.4.90.0200.06316.21
5.4.80.0130.06016.39
5.4.70.0000.08016.29
5.4.60.0030.07016.29
5.4.50.0030.04316.18
5.4.40.0030.07016.19
5.4.30.0100.07016.38
5.4.20.0130.06716.23
5.4.10.0100.07716.32
5.4.00.0070.07315.51
5.3.290.0100.07714.59
5.3.280.0100.06714.53
5.3.270.0100.07014.60
5.3.260.0100.06714.59
5.3.250.0130.06014.57
5.3.240.0070.07014.61
5.3.230.0100.06314.56
5.3.220.0030.04314.55
5.3.210.0030.08014.57
5.3.200.0030.07714.48
5.3.190.0130.07014.43
5.3.180.0100.07014.42
5.3.170.0070.07314.50
5.3.160.0200.05714.55
5.3.150.0100.06714.56
5.3.140.0130.06714.54
5.3.130.0170.06014.41
5.3.120.0030.04014.41
5.3.110.0000.04314.48
5.3.100.0070.07313.89
5.3.90.0130.07013.84
5.3.80.0030.08013.88
5.3.70.0170.07014.02
5.3.60.0100.05313.86
5.3.50.0030.07313.93
5.3.40.0070.07713.96
5.3.30.0170.06713.87
5.3.20.0100.03713.61
5.3.10.0070.05313.65
5.3.00.0030.06013.55
5.2.170.0070.06311.19
5.2.160.0170.05711.20
5.2.150.0000.05310.95
5.2.140.0030.05711.21
5.2.130.0030.06711.10
5.2.120.0030.06711.10
5.2.110.0070.05011.10
5.2.100.0100.05311.14
5.2.90.0130.05011.09
5.2.80.0070.05711.14
5.2.70.0030.06311.09
5.2.60.0170.05311.05
5.2.50.0000.05311.07
5.2.40.0030.06311.00
5.2.30.0100.05710.98
5.2.20.0070.04710.95
5.2.10.0000.06310.98
5.2.00.0100.06310.74
5.1.60.0030.04010.17
5.1.50.0070.02310.17
5.1.40.0030.05310.17
5.1.30.0100.04710.37
5.1.20.0030.03710.49
5.1.10.0070.05710.17
5.1.00.0070.05010.17
5.0.50.0000.02310.17
5.0.40.0000.04310.17
5.0.30.0000.03310.17
5.0.20.0030.04010.17
5.0.10.0030.02310.17
5.0.00.0000.05710.17
4.4.90.0100.03010.17
4.4.80.0070.03310.17
4.4.70.0030.03710.17
4.4.60.0030.03710.17
4.4.50.0030.03010.17
4.4.40.0000.03010.17
4.4.30.0070.02710.17
4.4.20.0030.01710.17
4.4.10.0000.04010.17
4.4.00.0000.05710.17
4.3.110.0070.02710.17
4.3.100.0000.01710.17
4.3.90.0030.02710.17
4.3.80.0100.04710.17
4.3.70.0070.02010.17
4.3.60.0000.03310.17
4.3.50.0030.03010.17
4.3.40.0030.04010.17
4.3.30.0070.02710.17
4.3.20.0000.03710.17
4.3.10.0000.03710.17
4.3.00.0000.02310.17

preferences:
38.51 ms | 400 KiB | 5 Q