3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function getFunc($turn) { 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.70.0100.01016.48
8.3.60.0120.00318.44
8.3.50.0140.00722.11
8.3.40.0150.00018.86
8.3.30.0070.00719.05
8.3.20.0070.00720.16
8.3.10.0040.00422.12
8.3.00.0040.00422.29
8.2.190.0100.01416.63
8.2.180.0070.01016.88
8.2.170.0070.01022.96
8.2.160.0070.00720.41
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0060.00319.49
8.2.110.0060.00322.08
8.2.100.0080.00419.64
8.2.90.0000.00819.22
8.2.80.0070.00317.97
8.2.70.0070.00417.63
8.2.60.0000.00817.93
8.2.50.0090.00018.07
8.2.40.0040.00418.09
8.2.30.0050.00218.11
8.2.20.0050.00217.78
8.2.10.0000.00819.42
8.2.00.0050.00217.84
8.1.280.0100.00725.92
8.1.270.0000.00822.22
8.1.260.0080.00026.35
8.1.250.0100.00028.09
8.1.240.0000.00923.58
8.1.230.0040.00719.13
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0040.00417.35
8.1.190.0050.00217.53
8.1.180.0040.00418.10
8.1.170.0050.00518.29
8.1.160.0000.00721.93
8.1.150.0040.00418.57
8.1.140.0040.00417.41
8.1.130.0070.00017.84
8.1.120.0070.00017.48
8.1.110.0030.00517.33
8.1.100.0030.00517.34
8.1.90.0040.00417.37
8.1.80.0040.00417.32
8.1.70.0000.00717.39
8.1.60.0030.00617.63
8.1.50.0000.00717.50
8.1.40.0050.00217.54
8.1.30.0040.00417.62
8.1.20.0050.00317.63
8.1.10.0020.00517.54
8.1.00.0000.00817.39
8.0.300.0040.00418.77
8.0.290.0070.00017.05
8.0.280.0070.00018.29
8.0.270.0040.00417.23
8.0.260.0030.00316.91
8.0.250.0000.00716.97
8.0.240.0000.00716.90
8.0.230.0000.01117.05
8.0.220.0030.00316.88
8.0.210.0040.00416.91
8.0.200.0070.00016.99
8.0.190.0000.00717.01
8.0.180.0000.00816.95
8.0.170.0040.00416.82
8.0.160.0070.00016.83
8.0.150.0050.00316.99
8.0.140.0050.00316.93
8.0.130.0050.00013.38
8.0.120.0040.00416.96
8.0.110.0070.00016.97
8.0.100.0000.00816.83
8.0.90.0040.00417.05
8.0.80.0090.01316.94
8.0.70.0040.00416.89
8.0.60.0070.00016.82
8.0.50.0000.00716.88
8.0.30.0170.00317.11
8.0.20.0150.00617.40
8.0.10.0000.00816.86
8.0.00.0120.00816.71
7.4.330.0000.00515.00
7.4.320.0000.00616.50
7.4.300.0000.00716.64
7.4.290.0000.00816.57
7.4.280.0070.00016.56
7.4.270.0000.00716.68
7.4.260.0030.00316.48
7.4.250.0000.00716.44
7.4.240.0000.00716.55
7.4.230.0030.00316.43
7.4.220.0070.01016.53
7.4.210.0090.00516.51
7.4.200.0070.00016.62
7.4.190.0000.00716.74
7.4.160.0070.01016.55
7.4.150.0100.00917.40
7.4.140.0080.01017.86
7.4.130.0130.00516.50
7.4.120.0100.00816.48
7.4.110.0100.00716.52
7.4.100.0070.01116.53
7.4.90.0120.00916.51
7.4.80.0120.00619.39
7.4.70.0110.00716.45
7.4.60.0030.01316.40
7.4.50.0000.00516.27
7.4.40.0030.01422.77
7.4.30.0060.01216.41
7.4.00.0100.00314.79
7.3.330.0000.00513.35
7.3.320.0000.00613.11
7.3.310.0030.00316.40
7.3.300.0050.00216.24
7.3.290.0140.00516.37
7.3.280.0070.00916.27
7.3.270.0090.00917.40
7.3.260.0030.01316.35
7.3.250.0100.00716.40
7.3.240.0100.00616.52
7.3.230.0170.00716.39
7.3.210.0100.00716.32
7.3.200.0090.00619.39
7.3.190.0120.00916.61
7.3.180.0060.00916.41
7.3.170.0100.00716.46
7.3.160.0070.01016.51
7.3.120.0000.01414.64
7.3.10.0060.00616.79
7.3.00.0040.01116.56
7.2.330.0100.00616.37
7.2.320.0040.01516.42
7.2.310.0170.00016.33
7.2.300.0060.01616.40
7.2.290.0070.01016.73
7.2.130.0060.00316.71
7.2.120.0080.00816.94
7.2.110.0030.00816.54
7.2.100.0090.00316.94
7.2.90.0040.00416.84
7.2.80.0030.01017.08
7.2.70.0030.01017.02
7.2.60.0110.00416.81
7.2.50.0090.00316.95
7.2.40.0070.00716.98
7.2.30.0130.00016.76
7.2.20.0070.00316.96
7.2.10.0060.00617.03
7.2.00.0120.00317.11
7.1.250.0090.00315.84
7.1.100.0000.01518.10
7.1.70.0040.00417.19
7.1.60.0040.01519.82
7.1.50.0140.01016.64
7.1.00.0070.06322.28
7.0.200.0080.00416.87
7.0.140.0030.07322.10
7.0.100.0070.06319.97
7.0.90.0070.04019.98
7.0.80.0100.04719.87
7.0.70.0100.04019.94
7.0.60.0200.06319.93
7.0.50.0100.05020.35
7.0.40.0070.07720.13
7.0.30.0130.07720.14
7.0.20.0070.08320.09
7.0.10.0070.08720.14
7.0.00.0030.07720.02
5.6.280.0070.07021.05
5.6.250.0070.07720.68
5.6.240.0170.06320.52
5.6.230.0230.05720.63
5.6.220.0100.07720.50
5.6.210.0070.08320.75
5.6.200.0100.07020.97
5.6.190.0100.08021.12
5.6.180.0100.08321.19
5.6.170.0070.05321.03
5.6.160.0270.06721.07
5.6.150.0100.06321.04
5.6.140.0030.08721.06
5.6.130.0070.04721.12
5.6.120.0070.08721.03
5.6.110.0200.06321.02
5.6.100.0100.07021.00
5.6.90.0070.04321.09
5.6.80.0070.04720.34
5.6.70.0030.04020.45
5.6.60.0030.04020.40
5.6.50.0030.04020.48
5.6.40.0000.04020.45
5.6.30.0030.03320.50
5.6.20.0000.04020.32
5.6.10.0130.02720.53
5.6.00.0130.03020.48
5.5.380.0100.07720.43
5.5.370.0100.06720.45
5.5.360.0070.07320.45
5.5.350.0070.08720.35
5.5.340.0030.08720.76
5.5.330.0070.08720.82
5.5.320.0070.07720.85
5.5.310.0170.07320.86
5.5.300.0030.06020.89
5.5.290.0030.07720.75
5.5.280.0100.07720.66
5.5.270.0070.07720.93
5.5.260.0030.08020.80
5.5.250.0130.06720.60
5.5.240.0070.04020.04
5.5.230.0070.03720.26
5.5.220.0100.04020.20
5.5.210.0030.03720.12
5.5.200.0070.03320.12
5.5.190.0030.04320.19
5.5.180.0070.03720.20
5.5.160.0070.05320.23
5.5.150.0200.06720.15
5.5.140.0070.03320.26
5.5.130.0070.08020.10
5.5.120.0000.06720.18
5.5.110.0030.05320.24
5.5.100.0000.04020.13
5.5.90.0030.04320.17
5.5.80.0070.03720.05
5.5.70.0070.03320.17
5.5.60.0070.03720.16
5.5.50.0070.03720.11
5.5.40.0130.03320.07
5.5.30.0030.04020.04
5.5.20.0070.03319.94
5.5.10.0000.04320.02
5.5.00.0070.04320.11
5.4.450.0000.05319.45
5.4.440.0100.04719.46
5.4.430.0030.04319.53
5.4.420.0070.07719.19
5.4.410.0000.04719.29
5.4.400.0000.04719.14
5.4.390.0130.03719.23
5.4.380.0100.05318.84
5.4.370.0070.03719.16
5.4.360.0070.03719.01
5.4.350.0030.03319.03
5.4.340.0130.02719.05
5.4.320.0030.03719.03
5.4.310.0070.04718.86
5.4.300.0070.07019.12
5.4.290.0100.03319.16
5.4.280.0000.06019.21
5.4.270.0070.03319.16
5.4.260.0030.04019.12
5.4.250.0030.03718.87
5.4.240.0100.07019.12
5.4.230.0030.04018.94
5.4.220.0000.04019.18
5.4.210.0070.04019.04
5.4.200.0070.03719.20
5.4.190.0030.05319.11
5.4.180.0030.04019.02
5.4.170.0100.03019.04
5.4.160.0000.04019.03
5.4.150.0130.02719.02
5.4.140.0070.03316.50
5.4.130.0000.03316.40
5.4.120.0000.03316.38
5.4.110.0000.04016.56
5.4.100.0030.03716.56
5.4.90.0030.03016.42
5.4.80.0070.02316.54
5.4.70.0000.04316.45
5.4.60.0070.03016.46
5.4.50.0000.06316.29
5.4.40.0030.03316.42
5.4.30.0030.03016.39
5.4.20.0030.03016.36
5.4.10.0030.07316.46
5.4.00.0070.07315.91
5.3.290.0000.03714.63
5.3.280.0030.04014.63
5.3.270.0070.07014.67
5.3.260.0000.05714.73
5.3.250.0070.03714.68
5.3.240.0100.03014.72
5.3.230.0000.04014.72
5.3.220.0070.03314.63
5.3.210.0000.04314.71
5.3.200.0070.02714.50
5.3.190.0070.03314.55
5.3.180.0070.03314.51
5.3.170.0070.03314.61
5.3.160.0100.02714.62
5.3.150.0030.03314.64
5.3.140.0000.04014.50
5.3.130.0100.03314.62
5.3.120.0070.03314.70
5.3.110.0130.07014.57
5.3.100.0070.07314.08
5.3.90.0030.08014.05
5.3.80.0100.07013.95
5.3.70.0100.06014.02
5.3.60.0030.06714.07
5.3.50.0130.06714.02
5.3.40.0070.08314.01
5.3.30.0100.04713.98
5.3.20.0100.03313.75
5.3.10.0030.07313.77
5.3.00.0070.08313.75
5.2.170.0070.06313.75
5.2.160.0070.03313.75
5.2.150.0100.05713.75
5.2.140.0070.02713.75
5.2.130.0100.05713.75
5.2.120.0100.05713.75
5.2.110.0070.03713.75
5.2.100.0070.05013.75
5.2.90.0000.06713.75
5.2.80.0030.05713.75
5.2.70.0030.03313.75
5.2.60.0030.06013.75
5.2.50.0130.05313.75
5.2.40.0070.06013.75
5.2.30.0030.04713.75
5.2.20.0000.06713.75
5.2.10.0130.04313.75
5.2.00.0000.06313.75
5.1.60.0030.05313.75
5.1.50.0070.05313.75
5.1.40.0100.02713.75
5.1.30.0000.06013.75
5.1.20.0030.05013.75
5.1.10.0130.02013.75
5.1.00.0070.05013.75
5.0.50.0030.04713.75
5.0.40.0030.04313.75
5.0.30.0030.05013.75
5.0.20.0000.04313.75
5.0.10.0070.04013.75
5.0.00.0000.06713.75
4.4.90.0000.01713.75
4.4.80.0000.01713.75
4.4.70.0030.03713.75
4.4.60.0000.03713.75
4.4.50.0030.02713.75
4.4.40.0030.04713.75
4.4.30.0000.04013.75
4.4.20.0000.03013.75
4.4.10.0030.03313.75
4.4.00.0000.05313.75
4.3.110.0000.03013.75
4.3.100.0030.03313.75
4.3.90.0000.01713.75
4.3.80.0000.05313.75
4.3.70.0000.03713.75
4.3.60.0000.02713.75
4.3.50.0000.03713.75
4.3.40.0000.05013.75
4.3.30.0030.03313.75
4.3.20.0030.03313.75
4.3.10.0000.03013.75
4.3.00.0000.02013.75

preferences:
54.5 ms | 401 KiB | 5 Q