3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clearAllCache($path) { $is_dot = array ('.', '..'); if (is_dir($path)) { $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST ); foreach ($iterator as $file) { if (version_compare(phpversion(), '5.2.17', '<=')) { if (in_array($file->getBasename(), $is_dot)) continue; } elseif (version_compare(phpversion(), '5.3', '<')) { if ($file->isDot()) continue; } if ($file->getBasename() !== 'index.php') unlink($file->getPathname()); } unset($iterator, $file); } }

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.0070.01019.35
7.1.100.0070.01018.04
7.1.70.0030.01016.97
7.1.60.0030.01919.22
7.1.50.0000.01416.86
7.1.00.0030.07722.37
7.0.200.0000.01016.69
7.0.140.0000.04022.12
7.0.60.0100.08019.95
7.0.50.0000.09317.85
7.0.40.0130.03719.97
7.0.30.0170.04720.23
7.0.20.0100.06020.22
7.0.10.0230.08020.22
7.0.00.0100.04020.09
5.6.280.0070.07021.10
5.6.210.0000.08320.61
5.6.200.0070.03718.18
5.6.190.0100.07320.47
5.6.180.3670.05320.61
5.6.170.0130.08020.46
5.6.160.0070.03720.57
5.6.150.0070.04018.29
5.6.140.0030.04718.28
5.6.130.0100.05018.19
5.6.120.0030.09321.00
5.6.110.0130.08021.12
5.6.100.0100.06720.98
5.6.90.0170.07320.96
5.6.80.0130.07320.53
5.6.70.0330.07320.38
5.5.350.0300.07320.39
5.5.340.0100.08317.94
5.5.330.0200.06720.42
5.5.320.0330.07320.38
5.5.310.0300.07320.19
5.5.300.0000.04317.95
5.5.290.0000.04317.98
5.5.280.0070.08720.97
5.5.270.0130.07720.77
5.5.260.0130.07020.85
5.5.250.0030.10020.62
5.5.240.0270.05320.19
5.4.450.0770.05719.58
5.4.440.0130.06019.55
5.4.430.0200.05019.44
5.4.420.0100.05719.46
5.4.410.0330.05319.11
5.4.400.0700.04319.32
5.4.390.0800.04719.34
5.4.380.0370.05318.47
5.4.370.0330.05318.70
5.4.360.0330.07018.75
5.4.350.0470.06318.71
5.4.340.0330.04718.81
5.4.320.0370.04718.49
5.4.310.0300.05318.68
5.4.300.0300.05018.75
5.4.290.0400.05018.79
5.4.280.0470.05018.71
5.4.270.0200.05718.80
5.4.260.0470.05718.72
5.4.250.0400.04718.56
5.4.240.0400.04718.74
5.4.230.0330.04318.73
5.4.220.0270.06318.59
5.4.210.0400.04718.48
5.4.200.0370.05316.62
5.4.190.0200.05718.63
5.4.180.0270.05318.48
5.4.170.0270.05318.70
5.4.160.0300.05718.65
5.4.150.0400.06718.58
5.4.140.0270.05316.19
5.4.130.0270.05016.27
5.4.120.0430.06016.20
5.4.110.0370.06016.26
5.4.100.0300.06716.26
5.4.90.0300.05316.23
5.4.80.0300.05316.16
5.4.70.0330.05016.19
5.4.60.0270.05016.14
5.4.50.0300.04316.23
5.4.40.0230.05716.27
5.4.30.0370.04316.39
5.4.20.0270.05716.18
5.4.10.0270.05016.22
5.4.00.0300.04315.73
5.3.290.0270.05314.64
5.3.280.0270.05014.70
5.3.270.0270.05714.65
5.3.260.0270.05314.73
5.3.250.0330.05314.81
5.3.240.0230.05714.77
5.3.230.0470.04014.59
5.3.220.0200.06014.60
5.3.210.0200.06014.54
5.3.200.0200.07714.59
5.3.190.0330.04714.77
5.3.180.0330.05014.77
5.3.170.0270.05314.62
5.3.160.0370.05014.78
5.3.150.0170.07014.62
5.3.140.0230.05314.57
5.3.130.0400.04014.59
5.3.120.0300.04714.55
5.3.110.0270.05314.58
5.3.100.0370.06014.10
5.3.90.0500.05314.13
5.3.80.0300.05314.06
5.3.70.0230.05714.05
5.3.60.0270.05314.03
5.3.50.0230.05314.07
5.3.40.0270.05013.99
5.3.30.0270.04713.89
5.3.20.0270.05313.74
5.3.10.0270.04713.71
5.3.00.0230.07313.69
5.2.170.0300.05311.39
5.2.160.0270.03711.20
5.2.150.0170.04711.15
5.2.140.0230.05011.14
5.2.130.0200.04311.10
5.2.120.0230.05311.32
5.2.110.0170.04711.18
5.2.100.0200.04711.32
5.2.90.0170.04311.32
5.2.80.0230.04311.22
5.2.70.0270.04311.13
5.2.60.0130.05011.16
5.2.50.0230.04311.10
5.2.40.0130.04311.04
5.2.30.0300.03311.04
5.2.20.0200.04011.05
5.2.10.0170.04311.05
5.2.00.0100.04710.74
5.1.60.0130.03710.14
5.1.50.0170.03310.05
5.1.40.0130.03710.06
5.1.30.0130.03710.53
5.1.20.0200.03310.43
5.1.10.0130.04010.12
5.1.00.0100.04310.21
5.0.50.0070.0338.58
5.0.40.0130.0278.44
5.0.30.0070.0508.39
5.0.20.0130.0238.21
5.0.10.0130.0278.27
5.0.00.0100.0478.17
4.4.90.0130.0207.39
4.4.80.0070.0337.39
4.4.70.0200.0177.39
4.4.60.0100.0207.39
4.4.50.0130.0237.39
4.4.40.0100.0407.39
4.4.30.0100.0207.39
4.4.20.0030.0307.39
4.4.10.0100.0277.39
4.4.00.0030.0477.39
4.3.110.0200.0207.39
4.3.100.0170.0237.39
4.3.90.0070.0237.39
4.3.80.0100.0377.39
4.3.70.0100.0307.39
4.3.60.0130.0177.39
4.3.50.0100.0337.39
4.3.40.0130.0337.39
4.3.30.0000.0277.39
4.3.20.0000.0337.39
4.3.10.0100.0207.39
4.3.00.0030.0207.34

preferences:
34.59 ms | 400 KiB | 5 Q