3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input= 9999999; function Prime($num) { if ($num < 2) return false; for ($i = 2; $i < $num; $i++) { if ($num % $i == 0) return false; } return true; } $callStartTime = microtime(true); for($i = $input; $i > 0; --$i) { if(Prime($i)){ echo $i; break; } } $callEndTime = microtime(true); $callTime = $callEndTime - $callStartTime; echo 'Call time was ', sprintf('%.4f',$callTime), " seconds", PHP_EOL;

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.00.0030.31515.00
7.3.120.0100.33814.64
7.3.110.0070.27314.79
7.3.100.0070.25314.93
7.3.90.0030.27714.73
7.3.80.0030.23114.70
7.3.70.0000.21814.82
7.3.60.0070.23514.99
7.3.50.0100.24115.04
7.3.40.0000.26114.61
7.3.30.0030.32314.87
7.3.20.0030.25116.70
7.3.10.0130.22116.79
7.3.00.0070.20816.69
7.2.250.0100.34115.33
7.2.240.0130.33615.00
7.2.230.0030.25614.88
7.2.220.0000.23014.95
7.2.210.0070.30414.84
7.2.200.0030.23615.15
7.2.190.0030.21715.12
7.2.180.0070.21415.14
7.2.170.0000.31814.86
7.2.00.0000.24319.33
7.1.330.0070.69915.91
7.1.320.0030.56515.76
7.1.310.0000.68015.87
7.1.300.0070.62116.05
7.1.290.0030.52215.97
7.1.280.0000.55815.91
7.1.270.0100.58115.89
7.1.260.0000.52615.84
7.1.70.0230.26217.25
7.1.60.0100.29919.86
7.1.50.0000.22817.11
7.1.00.0030.34722.48
7.0.200.0720.25714.79
7.0.110.0070.29719.93
7.0.100.0130.30019.97
7.0.90.0100.30320.01
7.0.80.0100.28319.91
7.0.70.0100.31019.95
7.0.60.0070.33720.04
7.0.50.0100.31719.87
7.0.40.0100.30319.78
7.0.30.0100.32319.65
7.0.20.0200.33719.58
7.0.10.0070.25719.65
7.0.00.0100.31019.70
5.6.280.0030.51721.02
5.6.260.0070.46720.66
5.6.250.0030.55720.66
5.6.240.0030.57320.67
5.6.230.0100.54320.57
5.6.220.0000.53720.65
5.6.210.0070.53320.70
5.6.200.0030.55320.55
5.6.190.0830.49020.66
5.6.180.0070.54720.63
5.6.170.0170.52720.82
5.6.160.0130.52020.59
5.6.150.0030.54720.66
5.6.140.0100.55020.56
5.6.130.0130.50320.64
5.6.120.0100.55320.55
5.6.110.0030.50320.84
5.6.100.0030.53720.54
5.6.90.0070.47320.60
5.6.80.0000.44320.04
5.6.70.0070.44020.01
5.6.60.0100.50320.01
5.6.50.0030.55719.96
5.6.40.0130.51719.95
5.6.30.0030.51719.83
5.6.20.0030.53019.98
5.6.10.0100.49019.99
5.6.00.0070.55319.83
5.5.380.0100.57717.60
5.5.370.0130.56317.60
5.5.360.0100.55717.50
5.5.350.0070.55017.68
5.5.340.0100.51318.13
5.5.330.0130.51018.10
5.5.320.0130.60718.14
5.5.310.0170.53717.91
5.5.300.0070.56718.07
5.5.290.0030.48318.10
5.5.280.0070.42318.25
5.5.270.0070.50018.21
5.5.260.0070.47318.25
5.5.250.0000.50717.92
5.5.240.0070.40717.49
5.5.230.0100.48717.31
5.5.220.0170.56017.45
5.5.210.0130.50717.31
5.5.200.0030.51317.41
5.5.190.0130.52317.42
5.5.180.0130.53717.40
5.5.160.0070.52317.27
5.5.150.0030.52317.48
5.5.140.0070.55317.48
5.5.130.0100.50317.45
5.5.120.0030.44317.26
5.5.110.0030.56317.18
5.5.100.0070.49717.17
5.5.90.0070.52717.38
5.5.80.0130.49717.08
5.5.70.0070.55317.34
5.5.60.0100.52017.37
5.5.50.0030.47717.37
5.5.40.0030.54717.15
5.5.30.0000.53317.45
5.5.20.0030.47317.16
5.5.10.0100.54317.36
5.5.00.0000.52317.16
5.4.450.0030.55719.27
5.4.440.0030.52719.32
5.4.430.0100.45719.50
5.4.420.0030.45019.57
5.4.410.0000.44319.19
5.4.400.0030.60019.17
5.4.390.0130.52019.33
5.4.380.0130.52318.98
5.4.370.0000.52319.00
5.4.360.0100.51319.18
5.4.350.0130.53719.01
5.4.340.0070.52019.01
5.4.320.0000.54719.03
5.4.310.0100.51719.09
5.4.300.0070.54719.00
5.4.290.0100.51319.18
5.4.280.0070.57319.31
5.4.270.0030.51319.14
5.4.260.0030.51719.18
5.4.250.0030.51019.16
5.4.240.0070.55319.07
5.4.230.0170.51019.18
5.4.220.0200.49719.13
5.4.210.0070.51319.02
5.4.200.0100.52319.00
5.4.190.0070.53019.08
5.4.180.0030.52318.98
5.4.170.0070.52319.23
5.4.160.0070.58019.12
5.4.150.0200.51319.16
5.4.140.0070.52016.64
5.4.130.0070.53716.34
5.4.120.0100.52016.54
5.4.110.0070.50016.57
5.4.100.0000.50716.41
5.4.90.0130.54716.26
5.4.80.0100.54316.24
5.4.70.0030.49316.57
5.4.60.0200.53316.36
5.4.50.0030.51316.29
5.4.40.0170.51316.52
5.4.30.0030.53016.33
5.4.20.0100.55016.47
5.4.10.0030.51716.23
5.4.00.0170.51715.99