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); 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.00316.13
7.3.00.0100.00716.59
7.2.130.0140.00416.02
7.2.120.0140.00816.19
7.2.110.0130.00916.75
7.2.100.0130.00316.39
7.2.90.0100.00716.30
7.2.80.0150.00716.66
7.2.70.0160.00316.45
7.2.60.0110.00416.09
7.2.50.0070.00716.16
7.2.40.0110.00716.23
7.2.30.0200.00816.30
7.2.20.0150.00816.30
7.2.10.0160.01216.27
7.2.00.0130.00217.96
7.1.250.0060.01015.20
7.1.70.0080.00816.89
7.1.60.0030.02019.21
7.1.50.0110.01416.93
7.1.00.0070.07022.54
7.0.200.0050.00516.78
7.0.140.0100.06722.09
7.0.100.0530.06020.06
7.0.90.0070.08320.03
7.0.80.0230.06020.13
7.0.70.0200.07719.86
7.0.60.0370.08320.06
7.0.50.0400.06720.34
7.0.40.0130.07320.09
7.0.30.0130.08020.17
7.0.20.0130.07019.95
7.0.10.0070.08020.00
7.0.00.0070.08020.02
5.6.280.0030.07320.89
5.6.250.0130.07020.63
5.6.240.0130.08020.75
5.6.230.0070.08720.63
5.6.220.0170.07020.61
5.6.210.0100.04720.48
5.6.200.0170.07721.06
5.6.190.0070.08021.04
5.6.180.0070.06321.04
5.6.170.0030.07721.05
5.6.160.0100.07720.94
5.6.150.0100.08021.02
5.6.140.0200.08021.06
5.6.130.0130.08021.02
5.6.120.0030.08720.99
5.6.110.0130.09021.10
5.6.100.0030.07321.07
5.6.90.0030.06020.91
5.6.80.0130.06020.40
5.6.70.0100.08020.51
5.6.60.0030.07720.47
5.6.50.0100.08020.41
5.6.40.0070.06320.53
5.6.30.0130.07320.37
5.6.20.0030.08020.48
5.6.10.0070.05720.52
5.6.00.0030.08020.39
5.5.380.0100.03720.40
5.5.370.0100.06720.43
5.5.360.0070.08320.36
5.5.350.0070.06320.33
5.5.340.0200.07320.73
5.5.330.0030.05320.87
5.5.320.0030.08020.92
5.5.310.0030.08320.83
5.5.300.0100.08320.89
5.5.290.0070.08720.88
5.5.280.0130.08020.83
5.5.270.0070.08720.77
5.5.260.0100.07020.89
5.5.250.0030.05720.73
5.5.240.0030.07020.28
5.5.230.0170.07720.11
5.5.220.0100.07320.13
5.5.210.0170.07020.29
5.5.200.0130.06720.27
5.5.190.0170.06020.21
5.5.180.0100.06720.18
5.5.160.0130.07320.16
5.5.150.0000.05020.24
5.5.140.0070.08020.11
5.5.130.0100.04720.08
5.5.120.0070.04720.25
5.5.110.0030.08720.14
5.5.100.0100.08020.14
5.5.90.0070.07719.94
5.5.80.0100.07020.01
5.5.70.0100.07020.00
5.5.60.0070.06720.09
5.5.50.0070.07320.08
5.5.40.0100.06320.05
5.5.30.0130.07020.07
5.5.20.0030.07320.13
5.5.10.0070.06719.95
5.5.00.0130.06720.01
5.4.450.0070.08319.31
5.4.440.0070.08019.47
5.4.430.0100.06019.11
5.4.420.0100.07719.42
5.4.410.0130.06319.30
5.4.400.0030.08319.06
5.4.390.0170.07018.93
5.4.380.0070.05718.98
5.4.370.0100.04718.82
5.4.360.0130.07318.79
5.4.350.0170.07019.14
5.4.340.0170.07019.12
5.4.320.0070.04719.13
5.4.310.0070.07719.05
5.4.300.0000.05018.79
5.4.290.0070.07019.12
5.4.280.0070.06718.90
5.4.270.0030.07018.97
5.4.260.0070.04319.23
5.4.250.0170.06319.07
5.4.240.0030.07019.09
5.4.230.0100.04719.11
5.4.220.0100.07318.78
5.4.210.0100.06319.09
5.4.200.0130.07019.07
5.4.190.0000.06319.02
5.4.180.0030.07719.09
5.4.170.0100.05318.93
5.4.160.0100.06019.01
5.4.150.0170.07019.02
5.4.140.0000.07716.27
5.4.130.0070.07016.34
5.4.120.0070.07016.29
5.4.110.0070.06716.43
5.4.100.0030.05316.24
5.4.90.0070.06716.20
5.4.80.0130.06316.39
5.4.70.0070.06316.32
5.4.60.0030.07016.40
5.4.50.0030.06016.19
5.4.40.0030.07316.44
5.4.30.0070.07316.41
5.4.20.0130.05716.28
5.4.10.0130.04016.33
5.4.00.0170.06715.77
5.3.290.0130.06314.66
5.3.280.0100.07314.45
5.3.270.0070.07014.55
5.3.260.0170.06714.62
5.3.250.0070.04314.60
5.3.240.0030.09014.59
5.3.230.0070.07714.52
5.3.220.0130.06314.57
5.3.210.0070.06314.54
5.3.200.0030.07314.58
5.3.190.0070.06014.52
5.3.180.0100.07314.41
5.3.170.0030.04714.57
5.3.160.0100.05314.41
5.3.150.0030.07314.56
5.3.140.0070.07714.40
5.3.130.0100.05714.41
5.3.120.0070.06714.41
5.3.110.0070.05314.46
5.3.100.0130.05013.90
5.3.90.0100.04013.93
5.3.80.0130.06714.00
5.3.70.0030.05013.98
5.3.60.0030.03713.97
5.3.50.0100.07313.95
5.3.40.0030.08013.91
5.3.30.0130.05013.78
5.3.20.0100.08313.55
5.3.10.0030.07013.65
5.3.00.0130.06313.65
5.2.170.0070.06311.11
5.2.160.0030.05711.19
5.2.150.0070.03711.14
5.2.140.0100.02710.96
5.2.130.0070.05311.03
5.2.120.0130.05311.12
5.2.110.0030.03311.16
5.2.100.0030.05711.14
5.2.90.0070.05711.09
5.2.80.0070.05711.12
5.2.70.0200.04710.92
5.2.60.0070.04311.11
5.2.50.0070.04011.04
5.2.40.0070.06011.02
5.2.30.0100.05310.89
5.2.20.0070.06010.96
5.2.10.0030.06010.77
5.2.00.0070.06010.80
5.1.60.0000.0479.98
5.1.50.0030.05310.08
5.1.40.0100.04710.09
5.1.30.0030.04310.47
5.1.20.0100.05310.27
5.1.10.0100.05310.05
5.1.00.0070.05310.17
5.0.50.0030.0338.66
5.0.40.0000.0208.50
5.0.30.0030.0378.30
5.0.20.0000.0378.29
5.0.10.0070.0308.23
5.0.00.0000.0378.17
4.4.90.0070.0338.13
4.4.80.0030.0338.13
4.4.70.0030.0378.13
4.4.60.0000.0178.13
4.4.50.0000.0308.13
4.4.40.0000.0578.13
4.4.30.0000.0238.13
4.4.20.0000.0308.13
4.4.10.0030.0338.13
4.4.00.0000.0308.13
4.3.110.0070.0108.13
4.3.100.0000.0378.13
4.3.90.0030.0238.13
4.3.80.0000.0278.13
4.3.70.0000.0308.13
4.3.60.0000.0238.13
4.3.50.0100.0278.13
4.3.40.0030.0378.13
4.3.30.0130.0208.13
4.3.20.0000.0308.13
4.3.10.0000.0338.13
4.3.00.0000.0308.13

preferences:
36.38 ms | 401 KiB | 5 Q