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.0080.00818.31
8.3.50.0110.00621.98
8.3.40.0120.00618.66
8.3.30.0070.00719.17
8.3.20.0130.00720.29
8.3.10.0040.00422.04
8.3.00.0040.00422.59
8.2.180.0090.00916.38
8.2.170.0100.00722.96
8.2.160.0110.00420.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.36
8.2.110.0060.00322.13
8.2.100.0080.00419.63
8.2.90.0040.00419.17
8.2.80.0000.00818.05
8.2.70.0030.00717.50
8.2.60.0000.00818.04
8.2.50.0060.00618.07
8.2.40.0050.00318.16
8.2.30.0000.00717.94
8.2.20.0040.00417.69
8.2.10.0050.00319.46
8.2.00.0000.00717.74
8.1.280.0070.01025.92
8.1.270.0000.00822.06
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0040.00423.76
8.1.230.0040.00719.21
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0000.00917.35
8.1.190.0040.00417.51
8.1.180.0000.00818.10
8.1.170.0040.00418.57
8.1.160.0080.00021.93
8.1.150.0040.00418.56
8.1.140.0000.00717.45
8.1.130.0070.00017.87
8.1.120.0070.00017.54
8.1.110.0040.00417.45
8.1.100.0000.00717.40
8.1.90.0000.00817.34
8.1.80.0030.00517.50
8.1.70.0080.00017.45
8.1.60.0030.00617.55
8.1.50.0040.00417.48
8.1.40.0000.00717.40
8.1.30.0000.00717.59
8.1.20.0000.00817.55
8.1.10.0000.00817.57
8.1.00.0060.00317.56
8.0.300.0070.00018.77
8.0.290.0000.00717.01
8.0.280.0080.00018.43
8.0.270.0050.00317.25
8.0.260.0030.00316.84
8.0.250.0000.00716.86
8.0.240.0020.00517.00
8.0.230.0060.00316.93
8.0.220.0030.00316.91
8.0.210.0000.00716.81
8.0.200.0070.00016.97
8.0.190.0030.00316.82
8.0.180.0040.00416.88
8.0.170.0000.00816.88
8.0.160.0040.00416.84
8.0.150.0000.00716.90
8.0.140.0050.00216.71
8.0.130.0030.00313.38
8.0.120.0030.00516.78
8.0.110.0040.00416.88
8.0.100.0040.00416.86
8.0.90.0040.00416.77
8.0.80.0060.00916.86
8.0.70.0070.00016.93
8.0.60.0040.00416.76
8.0.50.0040.00416.74
8.0.30.0180.00716.94
8.0.20.0120.00517.40
8.0.10.0090.00016.97
8.0.00.0090.01116.77
7.4.330.0030.00315.00
7.4.320.0000.00616.51
7.4.300.0040.00416.44
7.4.290.0000.01016.60
7.4.280.0030.00316.58
7.4.270.0040.00416.51
7.4.260.0070.00016.58
7.4.250.0040.00416.56
7.4.240.0030.00416.57
7.4.230.0000.00716.39
7.4.220.0100.00716.47
7.4.210.0080.00716.49
7.4.200.0000.00716.59
7.4.190.0000.00716.47
7.4.160.0080.00816.51
7.4.150.0060.01217.40
7.4.140.0120.00617.86
7.4.130.0050.01116.40
7.4.120.0160.00316.55
7.4.110.0170.00016.26
7.4.100.0070.01016.48
7.4.90.0160.00616.40
7.4.80.0120.00919.39
7.4.70.0030.01316.43
7.4.60.0050.01116.35
7.4.50.0000.00616.57
7.4.40.0040.01122.77
7.4.30.0080.00816.29
7.4.00.0080.00914.91
7.3.330.0020.00213.37
7.3.320.0060.00013.06
7.3.310.0030.00316.33
7.3.300.0060.00016.34
7.3.290.0130.00416.31
7.3.280.0090.00716.29
7.3.270.0130.00317.40
7.3.260.0140.00316.27
7.3.250.0100.01016.40
7.3.240.0100.00716.41
7.3.230.0090.01216.56
7.3.210.0100.01016.37
7.3.200.0100.00619.39
7.3.190.0130.00316.34
7.3.180.0030.01316.23
7.3.170.0070.01316.37
7.3.160.0090.01216.41
7.3.120.0050.00914.78
7.3.110.0070.01014.59
7.3.100.0000.01314.83
7.3.90.0000.01015.01
7.3.80.0090.00414.63
7.3.70.0030.00914.54
7.3.60.0030.01214.88
7.3.50.0070.00714.52
7.3.40.0100.00314.46
7.3.30.0070.00714.72
7.3.20.0090.00616.36
7.3.10.0040.01016.43
7.3.00.0040.00716.52
7.2.330.0090.00916.54
7.2.320.0090.00916.73
7.2.310.0130.00316.74
7.2.300.0100.00616.70
7.2.290.0120.00416.71
7.2.250.0030.01214.95
7.2.240.0030.01615.23
7.2.230.0000.00915.38
7.2.220.0070.01015.11
7.2.210.0030.01015.25
7.2.200.0040.01115.11
7.2.190.0070.01015.05
7.2.180.0130.00014.86
7.2.170.0110.00015.07
7.2.00.0040.01119.20
7.1.330.0040.01115.50
7.1.320.0060.00315.95
7.1.310.0060.00315.85
7.1.300.0130.00315.57
7.1.290.0100.00315.85
7.1.280.0000.00915.70
7.1.270.0040.00815.64
7.1.260.0040.00715.80
7.1.100.0080.00418.07
7.1.70.0000.00817.14
7.1.60.0070.01419.82
7.1.50.0030.01716.87
7.1.00.0000.08022.40
7.0.200.0080.00316.46
7.0.140.0030.07321.95
7.0.60.0100.07719.94
7.0.50.0130.07317.79
7.0.40.0070.04720.27
7.0.30.0270.06720.06
7.0.20.0370.07720.12
7.0.10.0330.07720.08
7.0.00.0130.07720.10
5.6.280.0000.07721.00
5.6.210.0030.04720.52
5.6.200.0000.08718.24
5.6.190.0030.09020.64
5.6.180.3270.03720.63
5.6.170.0230.08720.53
5.6.160.0070.08320.71
5.6.150.0030.08318.15
5.6.140.0030.04718.11
5.6.130.0070.03718.25
5.6.120.0070.04021.03
5.6.110.0070.04020.92
5.6.100.0100.07721.04
5.6.90.0170.08321.00
5.6.80.0130.05020.41
5.6.70.0300.06720.39
5.5.350.0100.07720.44
5.5.340.0070.07717.96
5.5.330.0070.06720.56
5.5.320.0230.03320.31
5.5.310.0330.07720.30
5.5.300.0030.08318.03
5.5.290.0030.07317.98
5.5.280.0070.05020.66
5.5.270.0130.07320.87
5.5.260.0130.05720.80
5.5.250.0230.06720.60
5.5.240.0030.09320.38
5.4.450.0130.05719.27
5.4.440.0130.05719.51
5.4.430.0100.05319.32
5.4.420.0170.06019.56
5.4.410.0130.05719.41
5.4.400.0830.00018.73
5.4.390.0970.00018.79
5.4.380.0230.05718.63
5.4.370.0330.04018.57
5.4.360.0170.05018.74
5.4.350.0200.05018.73
5.4.340.0100.06018.51
5.4.320.0040.04912.51
5.4.310.0080.03512.51
5.4.300.0070.03712.51
5.4.290.0060.03812.50
5.4.280.0060.04312.41
5.4.270.0130.05018.98
5.4.260.0030.06018.65
5.4.250.0100.06018.95
5.4.240.0170.05718.79
5.4.230.0070.05718.99
5.4.220.0070.07718.76
5.4.210.0100.07318.90
5.4.200.0170.07018.81
5.4.190.0100.05718.95
5.4.180.0170.05018.96
5.4.170.0100.07318.76
5.4.160.0100.05318.65
5.4.150.0130.05018.64
5.4.140.0100.06316.42
5.4.130.0100.05016.45
5.4.120.0100.05016.64
5.4.110.0170.04716.62
5.4.100.0100.05716.53
5.4.90.0130.04316.46
5.4.80.0130.06316.55
5.4.70.0030.06316.52
5.4.60.0070.05016.45
5.4.50.0070.06716.33
5.4.40.0100.05316.59
5.4.30.0200.05716.46
5.4.20.0030.05316.59
5.4.10.0070.06316.38
5.4.00.0070.06015.80
5.3.290.0040.04012.80
5.3.280.0030.05714.61
5.3.270.0170.06314.62
5.3.260.0100.05314.60
5.3.250.0070.05014.69
5.3.240.0070.07014.52
5.3.230.0130.07014.68
5.3.220.0100.05014.55
5.3.210.0170.04314.57
5.3.200.0130.04714.75
5.3.190.0100.06014.66
5.3.180.0230.06014.75
5.3.170.0130.05014.66
5.3.160.0030.05714.41
5.3.150.0070.05714.66
5.3.140.0130.05314.41
5.3.130.0100.06014.66
5.3.120.0070.05714.63
5.3.110.0100.06314.59
5.3.100.0170.06314.13
5.3.90.0070.06014.04
5.3.80.0030.05314.13
5.3.70.0200.05714.11
5.3.60.0070.05314.04
5.3.50.0130.06313.93
5.3.40.0070.05313.79
5.3.30.0000.05713.98
5.3.20.0100.05013.54
5.3.10.0130.05013.56
5.3.00.0070.05713.65
5.2.170.0070.05011.32
5.2.160.0030.05711.21
5.2.150.0170.05011.05
5.2.140.0130.03311.32
5.2.130.0100.03311.09
5.2.120.0100.03711.18
5.2.110.0100.04311.08
5.2.100.0100.05311.18
5.2.90.0070.05711.00
5.2.80.0070.03711.04
5.2.70.0030.06011.30
5.2.60.0170.03311.27
5.2.50.0070.05010.92
5.2.40.0100.03711.18
5.2.30.0000.06310.95
5.2.20.0070.03710.86
5.2.10.0070.04310.93
5.2.00.0070.03710.64
5.1.60.0130.0339.95
5.1.50.0030.03710.02
5.1.40.0000.04010.22
5.1.30.0000.05710.51
5.1.20.0000.06010.43
5.1.10.0070.0339.98
5.1.00.0070.04710.16
5.0.50.0030.0408.61
5.0.40.0070.0338.61
5.0.30.0030.0478.49
5.0.20.0030.0338.14
5.0.10.0030.0308.23
5.0.00.0100.0438.24
4.4.90.0070.0236.95
4.4.80.0100.0136.95
4.4.70.0000.0236.95
4.4.60.0100.0176.95
4.4.50.0070.0276.95
4.4.40.0000.0406.95
4.4.30.0000.0236.95
4.4.20.0000.0236.95
4.4.10.0100.0236.95
4.4.00.0030.0406.95
4.3.110.0100.0176.95
4.3.100.0000.0236.95
4.3.90.0030.0306.95
4.3.80.0000.0406.95
4.3.70.0070.0176.95
4.3.60.0100.0136.95
4.3.50.0070.0306.95
4.3.40.0070.0306.95
4.3.30.0030.0236.95
4.3.20.0000.0236.95
4.3.10.0070.0276.95
4.3.00.0000.0235.88

preferences:
44.67 ms | 400 KiB | 5 Q