3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function getFunc($enable) { //static $enable = false; //$enable = $turn; return function($str) use (&$enable) { if ($enable) { echo $str; } }; } public function run() { $func = $this->getFunc(true); $func('ok'); echo PHP_EOL.'---------------'.PHP_EOL; $this->getFunc(false); $func('not ok'); $this->getFunc(true); $func('--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.60.0140.00718.40
8.3.50.0090.01122.05
8.3.40.0090.00618.71
8.3.30.0110.00419.22
8.3.20.0110.00720.21
8.3.10.0040.00422.04
8.3.00.0040.00422.34
8.2.180.0150.00416.50
8.2.170.0110.00722.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.48
8.2.110.0080.00322.20
8.2.100.0040.00817.84
8.2.90.0000.01019.05
8.2.80.0050.00317.97
8.2.70.0080.00017.50
8.2.60.0060.00317.93
8.2.50.0090.00318.07
8.2.40.0030.00518.16
8.2.30.0000.00717.99
8.2.20.0050.00317.57
8.2.10.0040.00419.37
8.2.00.0040.00417.58
8.1.280.0100.00725.92
8.1.270.0040.00422.14
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0060.00323.97
8.1.230.0030.00719.22
8.1.220.0030.00617.78
8.1.210.0080.00018.77
8.1.200.0100.00017.23
8.1.190.0000.00717.53
8.1.180.0030.00518.10
8.1.170.0040.00418.66
8.1.160.0040.00422.03
8.1.150.0040.00418.64
8.1.140.0000.00717.36
8.1.130.0070.00017.83
8.1.120.0000.00717.55
8.1.110.0040.00417.44
8.1.100.0000.00717.51
8.1.90.0030.00317.40
8.1.80.0040.00417.43
8.1.70.0000.00717.36
8.1.60.0000.00917.57
8.1.50.0000.00817.52
8.1.40.0060.00317.54
8.1.30.0000.00817.61
8.1.20.0030.00617.70
8.1.10.0040.00717.48
8.1.00.0040.00417.53
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0040.00418.37
8.0.270.0000.00717.25
8.0.260.0000.00616.72
8.0.250.0030.00316.83
8.0.240.0000.00816.80
8.0.230.0000.00916.96
8.0.220.0030.00316.88
8.0.210.0000.00816.89
8.0.200.0060.00016.90
8.0.190.0030.00316.97
8.0.180.0040.00416.80
8.0.170.0050.00316.82
8.0.160.0000.00716.88
8.0.150.0000.00716.82
8.0.140.0040.00416.80
8.0.130.0060.00013.31
8.0.120.0040.00416.76
8.0.110.0040.00416.73
8.0.100.0000.00716.79
8.0.90.0040.00416.78
8.0.80.0090.00616.85
8.0.70.0050.00216.92
8.0.60.0040.00416.70
8.0.50.0000.00716.90
8.0.30.0130.00917.09
8.0.20.0120.00717.40
8.0.10.0000.00816.91
8.0.00.0060.01616.86
7.4.330.0050.00015.09
7.4.320.0030.00316.49
7.4.300.0030.00616.52
7.4.290.0030.00616.35
7.4.280.0070.00016.60
7.4.270.0040.00416.43
7.4.260.0070.00316.50
7.4.250.0030.00516.47
7.4.240.0040.00416.54
7.4.230.0030.00316.39
7.4.220.0030.01416.57
7.4.210.0140.00416.56
7.4.200.0000.00716.64
7.4.190.0040.00216.46
7.4.160.0040.01216.42
7.4.150.0090.00917.40
7.4.140.0050.01617.86
7.4.130.0110.00816.43
7.4.120.0090.01216.54
7.4.110.0070.01016.63
7.4.100.0100.00716.45
7.4.90.0170.00716.38
7.4.80.0100.01219.39
7.4.70.0110.00716.39
7.4.60.0070.01016.34
7.4.50.0000.00616.53
7.4.40.0100.00622.77
7.4.30.0070.01016.43
7.4.00.0120.00415.00
7.3.330.0030.00213.13
7.3.320.0000.00513.28
7.3.310.0070.00016.34
7.3.300.0000.00716.31
7.3.290.0100.00716.26
7.3.280.0100.00816.32
7.3.270.0140.01017.40
7.3.260.0070.01116.30
7.3.250.0100.01016.51
7.3.240.0060.01016.54
7.3.230.0080.00816.39
7.3.210.0120.00616.67
7.3.200.0110.00619.39
7.3.190.0060.01616.31
7.3.180.0110.00316.25
7.3.170.0040.01816.30
7.3.160.0030.01416.27
7.3.120.0110.00414.91
7.2.330.0080.00916.68
7.2.320.0180.00316.76
7.2.310.0130.01016.79
7.2.300.0110.00616.61
7.2.290.0120.00416.87
7.2.00.0000.01319.29
7.1.100.0000.00918.14
7.1.70.0000.00717.16
7.1.60.0170.00719.82
7.1.50.0090.01216.97
7.1.00.0100.07022.43
7.0.200.0090.00316.78
7.0.140.0070.07022.15
7.0.60.0300.06019.86
7.0.50.0070.04317.73
7.0.40.0070.05020.11
7.0.30.0300.07720.33
7.0.20.0230.04020.26
7.0.10.0070.05720.14
7.0.00.0130.08020.22
5.6.280.0000.07321.09
5.6.210.0170.05320.57
5.6.200.0100.08018.30
5.6.190.0030.04320.48
5.6.180.0330.07320.50
5.6.170.0230.05320.50
5.6.160.0000.04720.55
5.6.150.0170.07018.18
5.6.140.0070.04718.28
5.6.130.0130.06718.18
5.6.120.0100.08021.03
5.6.110.0030.05021.06
5.6.100.0030.08021.00
5.6.90.0030.05321.11
5.6.80.0070.08020.39
5.6.70.4500.04020.39
5.5.350.0030.07020.42
5.5.340.0070.03317.98
5.5.330.0200.07320.41
5.5.320.0130.04320.21
5.5.310.0330.07020.37
5.5.300.0030.06017.95
5.5.290.0100.08317.91
5.5.280.0070.06320.89
5.5.270.0100.06320.97
5.5.260.0100.07720.88
5.5.250.0100.07720.59
5.5.240.0030.03320.20
5.4.450.0100.06719.57
5.4.440.0230.05719.45
5.4.430.0300.04719.63
5.4.420.0030.06019.31
5.4.410.0100.05719.42
5.4.400.0830.00018.77
5.4.390.1600.00018.51
5.4.380.0270.05318.51
5.4.370.0170.05018.54
5.4.360.0030.06318.58
5.4.350.0270.04318.71
5.4.340.0100.06318.79
5.4.320.0060.04212.52
5.4.310.0080.04312.51
5.4.300.0110.03812.52
5.4.290.0070.03912.50
5.4.280.0070.03612.40
5.4.270.0100.05318.71
5.4.260.0030.06719.01
5.4.250.0100.05018.95
5.4.240.0130.07318.73
5.4.230.0100.07018.71
5.4.220.0170.08018.80
5.4.210.0200.03718.95
5.4.200.0070.05718.96
5.4.190.0200.06018.98
5.4.180.0200.05018.95
5.4.170.0130.06018.92
5.4.160.0100.07018.74
5.4.150.0100.05318.95
5.4.140.0130.04716.44
5.4.130.0130.04316.47
5.4.120.0100.06316.44
5.4.110.0070.08316.53
5.4.100.0100.06716.49
5.4.90.0170.05716.64
5.4.80.0100.04716.62
5.4.70.0070.05316.65
5.4.60.0030.05316.32
5.4.50.0100.07716.50
5.4.40.0170.05316.48
5.4.30.0100.05016.35
5.4.20.0200.04716.27
5.4.10.0100.05716.40
5.4.00.0130.04716.03
5.3.290.0060.04112.80
5.3.280.0130.06314.52
5.3.270.0200.06314.62
5.3.260.0200.06014.70
5.3.250.0130.05014.61
5.3.240.0200.05014.59
5.3.230.0170.05014.68
5.3.220.0100.07014.68
5.3.210.0070.07014.48
5.3.200.0130.04714.60
5.3.190.0070.05314.57
5.3.180.0070.05314.43
5.3.170.0130.07314.66
5.3.160.0100.06714.59
5.3.150.0100.06014.60
5.3.140.0170.05014.65
5.3.130.0130.05314.65
5.3.120.0100.07014.54
5.3.110.0130.05314.71
5.3.100.0100.04714.02
5.3.90.0170.05314.02
5.3.80.0100.05014.10
5.3.70.0100.05714.25
5.3.60.0100.07013.99
5.3.50.0030.05713.95
5.3.40.0070.05014.03
5.3.30.0130.06013.92
5.3.20.0070.04713.69
5.3.10.0130.04313.74
5.3.00.0130.05013.73
5.2.170.0030.06011.04
5.2.160.0030.05311.15
5.2.150.0070.04311.23
5.2.140.0030.04311.21
5.2.130.0030.04311.27
5.2.120.0070.05011.18
5.2.110.0170.02711.28
5.2.100.0100.04011.08
5.2.90.0100.03311.05
5.2.80.0070.04711.17
5.2.70.0030.04711.16
5.2.60.0000.04711.11
5.2.50.0030.04711.01
5.2.40.0130.03010.83
5.2.30.0130.04011.04
5.2.20.0070.05711.17
5.2.10.0100.05311.04
5.2.00.0030.04010.79
5.1.60.0100.0379.96
5.1.50.0070.0439.97
5.1.40.0100.0309.93
5.1.30.0070.03710.40
5.1.20.0070.03710.42
5.1.10.0070.03710.07
5.1.00.0030.05010.22
5.0.50.0000.0478.73
5.0.40.0100.0238.46
5.0.30.0000.0478.27
5.0.20.0070.0308.24
5.0.10.0000.0338.32
5.0.00.0030.0408.25
4.4.90.0030.0207.20
4.4.80.0000.0237.20
4.4.70.0030.0207.20
4.4.60.0100.0207.20
4.4.50.0030.0307.20
4.4.40.0000.0377.20
4.4.30.0070.0237.20
4.4.20.0070.0277.20
4.4.10.0070.0237.15
4.4.00.0130.0277.15
4.3.110.0070.0277.15
4.3.100.0030.0237.15
4.3.90.0030.0277.15
4.3.80.0030.0377.15
4.3.70.0030.0277.15
4.3.60.0030.0307.15
4.3.50.0000.0307.15
4.3.40.0030.0377.15
4.3.30.0070.0237.15
4.3.20.0030.0307.15
4.3.10.0000.0277.15
4.3.00.0100.0135.94

preferences:
43.3 ms | 401 KiB | 5 Q