3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clearAllCache($path) { $is_dot = array ('.', '..'); if (is_dir($path)) { if (version_compare(phpversion(), '5.3', '<')) { $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST ); } else { $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_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.0040.01119.06
7.1.100.0040.01117.49
7.1.70.0020.00517.09
7.1.60.0100.01619.22
7.1.50.0090.01516.86
7.1.00.0000.08022.57
7.0.200.0000.00816.73
7.0.140.0000.07021.95
7.0.60.0070.09019.96
7.0.50.0030.07717.88
7.0.40.0070.07020.42
7.0.30.0330.07020.29
7.0.20.0230.06720.21
7.0.10.0300.05320.24
7.0.00.0130.07720.23
5.6.280.0070.06721.13
5.6.210.0030.08720.74
5.6.200.0030.07718.25
5.6.190.0070.04020.28
5.6.180.3570.04720.61
5.6.170.0270.03020.47
5.6.160.0030.04320.54
5.6.150.0070.04718.18
5.6.140.0100.05018.18
5.6.130.0070.04318.20
5.6.120.0030.08321.02
5.6.110.0100.05021.00
5.6.100.0070.04021.13
5.6.90.0170.07720.98
5.6.80.0100.08020.39
5.6.70.0300.07020.36
5.5.350.0300.07720.34
5.5.340.0100.07718.04
5.5.330.0070.04720.37
5.5.320.0430.07720.36
5.5.310.0330.07720.36
5.5.300.0100.07717.96
5.5.290.0070.07717.97
5.5.280.0130.06020.64
5.5.270.0200.07020.66
5.5.260.0100.06020.81
5.5.250.0000.07020.50
5.5.240.0130.09020.28
5.4.450.0670.06319.48
5.4.440.0030.06019.32
5.4.430.0530.05019.66
5.4.420.0800.04319.54
5.4.410.0630.06019.19
5.4.400.0230.05319.11
5.4.390.0800.05019.20
5.4.380.0230.05718.54
5.4.370.0230.05718.48
5.4.360.0370.05018.75
5.4.350.0230.05718.72
5.4.340.0370.04718.69
5.4.320.0230.07718.73
5.4.310.0430.04318.74
5.4.300.0330.05018.71
5.4.290.0270.05018.58
5.4.280.0270.07318.71
5.4.270.0500.06718.73
5.4.260.0470.06018.65
5.4.250.0400.07018.67
5.4.240.0500.07018.79
5.4.230.0330.07018.63
5.4.220.0530.07018.52
5.4.210.0500.05718.78
5.4.200.0300.05316.60
5.4.190.0430.05318.74
5.4.180.0370.07018.67
5.4.170.0330.08018.49
5.4.160.0370.07018.73
5.4.150.0370.05018.73
5.4.140.0470.03716.23
5.4.130.0270.05316.43
5.4.120.0200.07716.21
5.4.110.0330.04316.25
5.4.100.0330.05716.43
5.4.90.0230.06016.18
5.4.80.0330.04716.21
5.4.70.0300.05016.25
5.4.60.0370.06316.24
5.4.50.0400.04016.40
5.4.40.0330.04716.16
5.4.30.0200.05716.21
5.4.20.0300.05716.21
5.4.10.0430.06316.31
5.4.00.0470.05715.89
5.3.290.0300.08014.70
5.3.280.0430.05314.77
5.3.270.0370.06714.82
5.3.260.0500.05314.62
5.3.250.0270.07014.72
5.3.240.0400.05714.65
5.3.230.0600.05014.78
5.3.220.0370.07014.80
5.3.210.0400.06714.62
5.3.200.0470.06014.76
5.3.190.0370.05714.62
5.3.180.0530.05714.58
5.3.170.0170.06014.69
5.3.160.0230.05714.62
5.3.150.0270.05314.60
5.3.140.0400.04714.67
5.3.130.0400.07314.62
5.3.120.0400.06314.73
5.3.110.0270.07314.54
5.3.100.0400.04314.23
5.3.90.0370.05314.21
5.3.80.0330.05314.14
5.3.70.0200.05314.14
5.3.60.0200.06314.06
5.3.50.0230.05714.06
5.3.40.0300.05013.94
5.3.30.0400.05314.09
5.3.20.0370.05013.73
5.3.10.0200.05713.65
5.3.00.0430.06313.64
5.2.170.0330.05011.25
5.2.160.0130.05011.25
5.2.150.0330.05311.28
5.2.140.0400.04311.39
5.2.130.0270.04311.33
5.2.120.0330.02711.18
5.2.110.0200.06711.11
5.2.100.0330.05311.14
5.2.90.0200.04311.14
5.2.80.0170.04711.23
5.2.70.0230.04011.18
5.2.60.0270.03711.19
5.2.50.0330.05011.04
5.2.40.0200.05311.11
5.2.30.0170.06011.09
5.2.20.0230.03711.02
5.2.10.0370.03710.93
5.2.00.0300.05010.77
5.1.60.0130.03710.19
5.1.50.0170.04310.03
5.1.40.0130.03710.06
5.1.30.0170.03710.53
5.1.20.0100.04710.57
5.1.10.0130.04010.07
5.1.00.0270.04310.12
5.0.50.0030.0438.63
5.0.40.0030.0438.45
5.0.30.0130.0478.32
5.0.20.0100.0378.35
5.0.10.0200.0308.21
5.0.00.0170.0478.21
4.4.90.0070.0307.38
4.4.80.0100.0277.38
4.4.70.0130.0277.38
4.4.60.0170.0237.38
4.4.50.0100.0307.38
4.4.40.0030.0507.38
4.4.30.0070.0307.38
4.4.20.0130.0307.38
4.4.10.0100.0337.38
4.4.00.0130.0407.38
4.3.110.0030.0377.38
4.3.100.0030.0337.38
4.3.90.0070.0307.38
4.3.80.0130.0407.38
4.3.70.0030.0337.38
4.3.60.0130.0237.38
4.3.50.0130.0277.38
4.3.40.0030.0507.38
4.3.30.0100.0277.38
4.3.20.0130.0237.38
4.3.10.0000.0337.38
4.3.00.0100.0237.34

preferences:
31.4 ms | 400 KiB | 5 Q