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() + $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.0130.00616.45
7.3.00.0190.00416.43
7.2.130.0100.00716.77
7.2.120.0100.00416.74
7.2.110.0100.00816.69
7.2.100.0090.00916.82
7.2.90.0140.00516.75
7.2.80.0110.01016.67
7.2.70.0080.00916.70
7.2.60.0130.00816.72
7.2.50.0120.00716.59
7.2.40.0140.00416.49
7.2.30.0100.00616.72
7.2.20.0130.00416.52
7.2.10.0080.00816.56
7.2.00.0110.00517.40
7.1.250.0120.00615.57
7.1.70.0000.00717.29
7.1.60.0100.01619.21
7.1.50.0110.01416.91
7.1.00.0100.03022.28
7.0.200.0100.00316.87
7.0.140.0000.08022.09
7.0.100.0100.09320.04
7.0.90.0200.08319.92
7.0.80.0130.05019.92
7.0.70.0130.07319.98
7.0.60.0200.07020.01
7.0.50.0230.04320.29
7.0.40.0170.07320.11
7.0.30.0100.08020.12
7.0.20.0100.08320.18
7.0.10.0070.08320.09
7.0.00.0070.08019.92
5.6.280.0030.07321.03
5.6.250.0030.08020.82
5.6.240.0100.08320.76
5.6.230.0070.04020.69
5.6.220.0100.04020.68
5.6.210.0030.09020.77
5.6.200.0100.05021.18
5.6.190.0070.08020.97
5.6.180.0030.08321.11
5.6.170.0130.08021.11
5.6.160.0100.08020.96
5.6.150.0200.08721.09
5.6.140.0070.08721.04
5.6.130.0130.06321.17
5.6.120.0270.06721.04
5.6.110.0070.07320.93
5.6.100.0030.08020.95
5.6.90.0100.08021.09
5.6.80.0070.06020.40
5.6.70.0000.07320.44
5.6.60.0130.05720.43
5.6.50.0000.08320.48
5.6.40.0100.07720.31
5.6.30.0030.07720.43
5.6.20.0100.05720.38
5.6.10.0100.06720.43
5.6.00.0070.07720.35
5.5.380.0030.05320.39
5.5.370.0130.07720.39
5.5.360.0070.08020.56
5.5.350.0070.08720.48
5.5.340.0070.08020.83
5.5.330.0030.05020.89
5.5.320.0170.06320.84
5.5.310.0030.08720.86
5.5.300.0070.08020.80
5.5.290.0000.08720.84
5.5.280.0100.08020.82
5.5.270.0030.08320.73
5.5.260.0000.08320.93
5.5.250.0070.08020.69
5.5.240.0170.06320.28
5.5.230.0030.09020.17
5.5.220.0070.07020.27
5.5.210.0030.08020.16
5.5.200.0100.07720.17
5.5.190.0000.08020.11
5.5.180.0000.08320.19
5.5.160.0170.06720.20
5.5.150.0100.07720.27
5.5.140.0070.08020.24
5.5.130.0170.06720.22
5.5.120.0130.07720.09
5.5.110.0070.07720.13
5.5.100.0100.04320.12
5.5.90.0030.06719.98
5.5.80.0070.08720.16
5.5.70.0070.07720.15
5.5.60.0200.04720.09
5.5.50.0070.05020.04
5.5.40.0100.04020.12
5.5.30.0070.05720.11
5.5.20.0100.08020.08
5.5.10.0030.08720.08
5.5.00.0070.05320.03
5.4.450.0070.05019.12
5.4.440.0100.06319.29
5.4.430.0200.07719.39
5.4.420.0070.04019.38
5.4.410.0070.03319.32
5.4.400.0030.03718.82
5.4.390.0070.04019.10
5.4.380.0000.06018.82
5.4.370.0030.07018.95
5.4.360.0000.08719.12
5.4.350.0130.06718.95
5.4.340.0100.06018.98
5.4.320.0030.05018.98
5.4.310.0070.06319.12
5.4.300.0130.07019.05
5.4.290.0070.07718.95
5.4.280.0200.07018.95
5.4.270.0030.07019.12
5.4.260.0070.08019.02
5.4.250.0070.06318.80
5.4.240.0100.07319.14
5.4.230.0100.07318.94
5.4.220.0030.08319.05
5.4.210.0130.07018.96
5.4.200.0100.03318.89
5.4.190.0030.04019.11
5.4.180.0100.07019.22
5.4.170.0200.06019.02
5.4.160.0000.04318.88
5.4.150.0030.07018.88
5.4.140.0130.07316.13
5.4.130.0130.06716.34
5.4.120.0030.07016.36
5.4.110.0030.08316.27
5.4.100.0100.04316.43
5.4.90.0000.08016.21
5.4.80.0130.05016.41
5.4.70.0030.07716.38
5.4.60.0030.04016.41
5.4.50.0030.04316.36
5.4.40.0030.03716.34
5.4.30.0100.03016.23
5.4.20.0070.03716.43
5.4.10.0070.03716.39
5.4.00.0070.05715.72
5.3.290.0000.08714.62
5.3.280.0070.06014.61
5.3.270.0100.07014.61
5.3.260.0070.07314.57
5.3.250.0070.07014.58
5.3.240.0070.07014.48
5.3.230.0100.07314.59
5.3.220.0100.05314.58
5.3.210.0100.06014.54
5.3.200.0130.07014.40
5.3.190.0030.07014.43
5.3.180.0100.08014.49
5.3.170.0100.06714.56
5.3.160.0000.04014.42
5.3.150.0070.06714.43
5.3.140.0130.03314.41
5.3.130.0070.03714.41
5.3.120.0070.03714.54
5.3.110.0030.03714.54
5.3.100.0000.04014.03
5.3.90.0000.04014.02
5.3.80.0070.05313.98
5.3.70.0030.03313.81
5.3.60.0030.03713.93
5.3.50.0100.03013.82
5.3.40.0070.03313.93
5.3.30.0130.03013.91
5.3.20.0070.07313.48
5.3.10.0100.06713.66
5.3.00.0030.07013.56
5.2.170.0100.04011.15
5.2.160.0000.03011.16
5.2.150.0000.03311.15
5.2.140.0100.05310.97
5.2.130.0130.05010.98
5.2.120.0070.05310.97
5.2.110.0130.03710.90
5.2.100.0030.05011.15
5.2.90.0000.04711.14
5.2.80.0000.03010.95
5.2.70.0000.05010.93
5.2.60.0000.03011.06
5.2.50.0000.03010.89
5.2.40.0000.03711.00
5.2.30.0030.04010.98
5.2.20.0030.02710.96
5.2.10.0030.04310.93
5.2.00.0000.03010.86
5.1.60.0000.04710.10
5.1.50.0000.0239.99
5.1.40.0000.0309.95
5.1.30.0000.02710.25
5.1.20.0070.02010.27
5.1.10.0030.02310.08
5.1.00.0070.02710.16
5.0.50.0030.0179.95
5.0.40.0000.0239.95
5.0.30.0070.0239.95
5.0.20.0000.0209.95
5.0.10.0030.0179.95
5.0.00.0000.0339.95
4.4.90.0030.0139.95
4.4.80.0000.0179.95
4.4.70.0030.0279.95
4.4.60.0000.0179.95
4.4.50.0000.0209.95
4.4.40.0000.0239.95
4.4.30.0000.0179.95
4.4.20.0030.0139.95
4.4.10.0000.0139.95
4.4.00.0000.0279.95
4.3.110.0030.0139.95
4.3.100.0000.0209.95
4.3.90.0000.0179.95
4.3.80.0000.0279.95
4.3.70.0030.0139.95
4.3.60.0000.0179.95
4.3.50.0030.0139.95
4.3.40.0000.0379.95
4.3.30.0030.0139.95
4.3.20.0030.0239.95
4.3.10.0000.0139.95
4.3.00.0000.0179.95

preferences:
33.56 ms | 400 KiB | 5 Q