3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function getFunc($enable) { static $enable = false; return function($str) use ($enable) { if ($eneble) { echo $str; } }; } public function run() { $func = $this->getFunc(true); $func('ok'); echo PHP_EOL.'---------------'.PHP_EOL; $this->getFunc(false); $func('not ok'); } } $test = new Test(); $test->run();

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)
8.3.40.0140.00718.97
8.3.30.0140.00019.04
8.3.20.0080.00020.31
8.3.10.0040.00422.05
8.3.00.0040.00422.50
8.2.170.0090.00622.96
8.2.160.0070.00720.35
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0000.00817.63
8.2.110.0030.00721.09
8.2.100.0070.00717.75
8.2.90.0000.00819.08
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0000.00817.93
8.2.50.0000.00918.10
8.2.40.0000.00720.52
8.2.30.0000.00717.94
8.2.20.0040.00417.66
8.2.10.0030.00619.49
8.2.00.0060.00317.72
8.1.270.0070.00022.09
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0000.00920.83
8.1.230.0080.00420.91
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0080.00017.35
8.1.190.0000.00817.10
8.1.180.0080.00018.10
8.1.170.0030.00618.46
8.1.160.0000.00722.18
8.1.150.0040.00418.67
8.1.140.0040.00417.36
8.1.130.0000.00717.71
8.1.120.0070.00017.44
8.1.110.0060.00317.45
8.1.100.0000.00717.44
8.1.90.0040.00417.36
8.1.80.0080.00017.51
8.1.70.0000.00717.43
8.1.60.0060.00317.57
8.1.50.0040.00417.55
8.1.40.0040.00417.52
8.1.30.0040.00417.53
8.1.20.0060.00317.55
8.1.10.0000.00717.53
8.1.00.0040.00417.46
8.0.300.0040.00418.77
8.0.290.0090.00016.63
8.0.280.0000.00718.44
8.0.270.0030.00317.15
8.0.260.0030.00316.90
8.0.250.0000.00716.91
8.0.240.0040.00416.88
8.0.230.0080.00317.07
8.0.220.0070.00016.84
8.0.210.0000.00716.89
8.0.200.0000.00816.89
8.0.190.0070.00017.03
8.0.180.0030.00517.00
8.0.170.0040.00416.95
8.0.160.0040.00416.93
8.0.150.0040.00416.96
8.0.140.0000.00716.80
8.0.130.0000.00513.31
8.0.120.0030.00516.91
8.0.110.0000.00716.84
8.0.100.0000.00816.79
8.0.90.0000.00716.80
8.0.80.0030.01216.89
8.0.70.0050.00316.89
8.0.60.0040.00416.85
8.0.50.0000.00716.80
8.0.30.0080.01117.23
8.0.20.0110.00917.40
8.0.10.0030.00617.06
8.0.00.0130.00616.64
7.4.330.0000.00515.00
7.4.320.0030.00316.64
7.4.300.0040.00416.46
7.4.290.0030.00316.51
7.4.280.0080.00016.34
7.4.270.0000.00816.55
7.4.260.0000.00716.50
7.4.250.0000.00716.56
7.4.240.0020.00516.53
7.4.230.0030.00316.47
7.4.220.0130.00316.53
7.4.210.0120.00416.63
7.4.200.0080.00016.68
7.4.190.0000.00716.68
7.4.160.0140.00416.42
7.4.150.0150.00817.40
7.4.140.0060.01117.86
7.4.130.0080.00816.45
7.4.120.0090.00916.52
7.4.110.0160.00016.61
7.4.100.0160.00716.59
7.4.90.0120.01216.43
7.4.80.0130.00619.39
7.4.70.0090.00916.62
7.4.60.0090.00816.28
7.4.50.0050.00316.56
7.4.40.0150.00422.77
7.4.30.0120.00416.49
7.4.00.0040.01215.04
7.3.330.0050.00013.22
7.3.320.0020.00213.46
7.3.310.0030.00316.30
7.3.300.0000.00716.22
7.3.290.0110.00916.37
7.3.280.0080.00916.30
7.3.270.0100.00717.40
7.3.260.0170.00716.38
7.3.250.0110.00816.39
7.3.240.0100.00616.57
7.3.230.0100.00716.39
7.3.210.0060.01016.29
7.3.200.0080.00819.39
7.3.190.0040.01416.43
7.3.180.0060.01016.44
7.3.170.0100.00716.44
7.3.160.0120.00916.32
7.3.120.0100.00314.78
7.2.330.0140.00316.78
7.2.320.0100.01316.46
7.2.310.0110.01116.29
7.2.300.0090.00916.66
7.2.290.0060.00916.66
7.2.00.0100.00319.17
7.1.100.0040.00718.04
7.1.70.0000.00717.28
7.1.60.0070.01819.82
7.1.50.0070.00716.90
7.1.00.0000.07722.35
7.0.200.0030.00716.82
7.0.140.0070.07021.97
7.0.60.0200.06319.82
7.0.50.0130.06717.86
7.0.40.0070.04320.27
7.0.30.0230.05720.21
7.0.20.0230.08020.27
7.0.10.0300.07020.18
7.0.00.0100.08020.10
5.6.280.0070.07021.08
5.6.210.0070.03720.62
5.6.200.0100.08318.18
5.6.190.0070.06020.48
5.6.180.4400.06320.73
5.6.170.0470.05320.47
5.6.160.0100.08020.61
5.6.150.0070.05318.17
5.6.140.0070.03718.14
5.6.130.0100.03718.22
5.6.120.0130.03321.06
5.6.110.0130.07320.99
5.6.100.0100.04320.99
5.6.90.0130.05021.12
5.6.80.0030.04020.30
5.6.70.0270.05720.38
5.5.350.0030.08320.35
5.5.340.0030.05718.09
5.5.330.0100.06720.35
5.5.320.0130.05320.24
5.5.310.0270.08320.24
5.5.300.0000.07317.98
5.5.290.0070.08017.95
5.5.280.0130.04720.79
5.5.270.0100.07320.85
5.5.260.0100.03320.87
5.5.250.0070.06720.51
5.5.240.0100.06320.30
5.4.450.0170.06019.58
5.4.440.0030.06719.61
5.4.430.0200.05019.42
5.4.420.0030.07319.39
5.4.410.0100.07719.36
5.4.400.0830.00018.62
5.4.390.0830.00018.57
5.4.380.0230.05318.57
5.4.370.0170.05018.80
5.4.360.0230.04318.76
5.4.350.0270.05718.63
5.4.340.0170.05018.54
5.4.320.0050.03912.51
5.4.310.0070.03612.51
5.4.300.0060.03512.51
5.4.290.0060.03812.50
5.4.280.0090.03312.40
5.4.270.0030.05719.01
5.4.260.0100.07018.65
5.4.250.0200.04718.99
5.4.240.0070.06018.98
5.4.230.0070.08318.94
5.4.220.0130.07019.00
5.4.210.0200.05719.01
5.4.200.0130.07318.84
5.4.190.0230.05718.90
5.4.180.0100.05018.64
5.4.170.0170.07018.74
5.4.160.0170.06318.78
5.4.150.0100.07718.64
5.4.140.0070.07016.45
5.4.130.0270.05016.44
5.4.120.0070.07716.39
5.4.110.0200.06016.67
5.4.100.0100.06316.54
5.4.90.0130.07016.64
5.4.80.0100.05716.59
5.4.70.0070.05016.43
5.4.60.0130.07016.40
5.4.50.0100.07316.39
5.4.40.0170.04316.58
5.4.30.0130.04716.48
5.4.20.0170.06716.56
5.4.10.0070.05316.39
5.4.00.0070.05715.98
5.3.290.0070.03812.80
5.3.280.0200.06314.75
5.3.270.0130.06014.52
5.3.260.0130.06014.69
5.3.250.0100.04714.61
5.3.240.0130.06314.71
5.3.230.0100.06314.70
5.3.220.0070.05314.57
5.3.210.0100.07314.72
5.3.200.0030.05714.65
5.3.190.0200.04314.59
5.3.180.0100.04714.40
5.3.170.0070.05314.55
5.3.160.0030.06314.56
5.3.150.0130.07014.59
5.3.140.0130.05714.55
5.3.130.0170.04714.65
5.3.120.0030.08014.46
5.3.110.0100.07714.55
5.3.100.0100.05014.02
5.3.90.0130.04314.12
5.3.80.0070.05314.04
5.3.70.0130.04014.25
5.3.60.0030.06014.02
5.3.50.0070.05014.12
5.3.40.0100.06014.04
5.3.30.0130.04314.08
5.3.20.0100.06713.69
5.3.10.0100.06313.73
5.3.00.0070.07713.73
5.2.170.0070.04011.13
5.2.160.0030.06010.98
5.2.150.0100.05711.13
5.2.140.0000.04711.30
5.2.130.0070.04311.26
5.2.120.0170.03311.18
5.2.110.0130.03711.09
5.2.100.0200.04711.05
5.2.90.0070.05711.08
5.2.80.0100.03711.26
5.2.70.0100.05310.99
5.2.60.0100.04011.21
5.2.50.0100.04711.11
5.2.40.0000.04711.07
5.2.30.0100.05310.97
5.2.20.0100.04310.95
5.2.10.0130.03310.96
5.2.00.0070.05310.71
5.1.60.0000.0379.92
5.1.50.0030.05010.09
5.1.40.0100.0339.95
5.1.30.0100.04710.53
5.1.20.0030.04710.52
5.1.10.0030.04310.16
5.1.00.0170.02710.26
5.0.50.0030.0308.38
5.0.40.0100.0338.32
5.0.30.0070.0408.22
5.0.20.0100.0278.02
5.0.10.0130.0208.23
5.0.00.0070.0478.11
4.4.90.0030.0237.20
4.4.80.0100.0137.20
4.4.70.0030.0237.20
4.4.60.0030.0237.20
4.4.50.0030.0207.20
4.4.40.0000.0377.20
4.4.30.0100.0277.20
4.4.20.0030.0237.20
4.4.10.0000.0337.20
4.4.00.0100.0277.20
4.3.110.0070.0277.20
4.3.100.0070.0177.20
4.3.90.0030.0207.20
4.3.80.0070.0277.20
4.3.70.0000.0277.20
4.3.60.0130.0207.20
4.3.50.0070.0237.20
4.3.40.0070.0337.20
4.3.30.0070.0277.20
4.3.20.0030.0207.20
4.3.10.0030.0237.20
4.3.00.0070.0175.93

preferences:
47.03 ms | 400 KiB | 5 Q