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 ($enable) { 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.0070.00718.57
8.3.30.0100.00319.12
8.3.20.0000.00720.22
8.3.10.0060.00323.48
8.3.00.0040.00420.80
8.2.170.0110.00422.96
8.2.160.0130.00720.35
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0100.01026.16
8.2.120.0080.00019.83
8.2.110.0060.00322.22
8.2.100.0040.00717.91
8.2.90.0060.00319.23
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0130.00017.67
8.2.50.0000.00818.07
8.2.40.0080.00018.09
8.2.30.0050.00317.94
8.2.20.0070.00017.71
8.2.10.0050.00217.80
8.2.00.0050.00317.68
8.1.270.0050.00223.98
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00323.97
8.1.230.0130.00518.89
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0070.00317.35
8.1.190.0050.00317.53
8.1.180.0040.00418.10
8.1.170.0060.00318.57
8.1.160.0040.00422.14
8.1.150.0040.00418.70
8.1.140.0040.00417.49
8.1.130.0070.00017.77
8.1.120.0000.00917.51
8.1.110.0000.00717.36
8.1.100.0040.00417.35
8.1.90.0040.00417.40
8.1.80.0000.00717.45
8.1.70.0080.00017.36
8.1.60.0030.00617.50
8.1.50.0080.00017.48
8.1.40.0000.00817.50
8.1.30.0040.00417.57
8.1.20.0000.00717.52
8.1.10.0040.00417.45
8.1.00.0030.00617.55
8.0.300.0040.00418.77
8.0.290.0000.00817.16
8.0.280.0030.00318.43
8.0.270.0030.00517.26
8.0.260.0000.00716.77
8.0.250.0060.00016.84
8.0.240.0030.00316.88
8.0.230.0030.00316.96
8.0.220.0030.00516.92
8.0.210.0030.00316.76
8.0.200.0000.00616.97
8.0.190.0050.00316.84
8.0.180.0040.00416.92
8.0.170.0070.00016.95
8.0.160.0040.00416.87
8.0.150.0070.00016.87
8.0.140.0040.00416.90
8.0.130.0000.00613.27
8.0.120.0040.00416.83
8.0.110.0040.00416.77
8.0.100.0080.00016.89
8.0.90.0000.00716.93
8.0.80.0130.00316.84
8.0.70.0000.00716.86
8.0.60.0000.00816.79
8.0.50.0040.00416.88
8.0.30.0080.01117.02
8.0.20.0130.00517.40
8.0.10.0040.00417.00
8.0.00.0090.00916.91
7.4.330.0020.00215.16
7.4.320.0030.00316.49
7.4.300.0060.00016.58
7.4.290.0000.00716.61
7.4.280.0030.00316.58
7.4.270.0070.00016.52
7.4.260.0030.00316.48
7.4.250.0000.00716.35
7.4.240.0020.00616.50
7.4.230.0040.00416.35
7.4.220.0090.00916.53
7.4.210.0060.01016.54
7.4.200.0000.00716.62
7.4.190.0070.00016.66
7.4.160.0050.01016.43
7.4.150.0180.00617.40
7.4.140.0160.00617.86
7.4.130.0100.00816.54
7.4.120.0090.00916.51
7.4.110.0170.00016.47
7.4.100.0170.00316.52
7.4.90.0030.01316.50
7.4.80.0070.01016.40
7.4.70.0060.00916.36
7.4.60.0100.00616.39
7.4.50.0040.00016.47
7.4.40.0030.01322.77
7.4.30.0120.00916.41
7.4.10.0100.00715.05
7.4.00.0090.00815.09
7.3.330.0030.00313.29
7.3.320.0030.00313.04
7.3.310.0080.00016.39
7.3.300.0000.00716.30
7.3.290.0060.01216.30
7.3.280.0070.01016.32
7.3.270.0090.00817.40
7.3.260.0090.00916.60
7.3.250.0110.00716.31
7.3.240.0060.01516.30
7.3.230.0110.00616.57
7.3.210.0150.00316.64
7.3.200.0100.00719.39
7.3.190.0100.01016.57
7.3.180.0070.01416.66
7.3.170.0130.00516.64
7.3.160.0090.00916.68
7.3.130.0090.00914.58
7.3.120.0090.00714.77
7.3.110.0040.01114.73
7.3.100.0000.01215.10
7.3.90.0080.00414.79
7.3.80.0030.00814.75
7.3.70.0030.01014.46
7.3.60.0000.01214.68
7.3.50.0060.01014.54
7.3.40.0100.00614.89
7.3.30.0030.00614.86
7.3.20.0030.01016.80
7.3.10.0000.01116.64
7.3.00.0090.00316.73
7.2.330.0090.00916.66
7.2.320.0080.00816.75
7.2.310.0040.01316.62
7.2.300.0090.00916.48
7.2.290.0060.00916.35
7.2.260.0090.00615.24
7.2.250.0070.01115.28
7.2.240.0090.00614.91
7.2.230.0070.01015.19
7.2.220.0090.00614.92
7.2.210.0090.00414.89
7.2.200.0000.01315.08
7.2.190.0040.00915.11
7.2.180.0000.01115.08
7.2.170.0000.01714.96
7.2.160.0060.00615.13
7.2.150.0130.00016.86
7.2.140.0030.01016.89
7.2.130.0030.01017.05
7.2.120.0100.00316.92
7.2.110.0060.00916.72
7.2.100.0030.00916.71
7.2.90.0130.00317.00
7.2.80.0030.00917.09
7.2.70.0000.01516.94
7.2.60.0040.01116.90
7.2.50.0060.00316.79
7.2.40.0070.01017.09
7.2.30.0120.00616.79
7.2.20.0000.01416.95
7.2.10.0090.00616.79
7.2.00.0090.00818.11
7.1.330.0000.01515.79
7.1.320.0090.00915.77
7.1.310.0100.00715.68
7.1.300.0070.00715.80
7.1.290.0060.00915.67
7.1.280.0040.00715.67
7.1.270.0090.00615.38
7.1.260.0030.00515.84
7.1.250.0060.00615.91
7.1.240.0060.00315.46
7.1.230.0030.00915.88
7.1.220.0060.00715.57
7.1.210.0090.00915.61
7.1.200.0050.00915.75
7.1.190.0030.01215.62
7.1.180.0000.01315.86
7.1.170.0040.01415.59
7.1.160.0070.01115.93
7.1.150.0080.00415.88
7.1.140.0060.00915.60
7.1.130.0090.00615.62
7.1.120.0110.00415.86
7.1.110.0030.00615.86
7.1.100.0070.00516.68
7.1.90.0070.00715.78
7.1.80.0060.00915.84
7.1.70.0020.01016.41
7.1.60.0080.00917.46
7.1.50.0130.00616.35
7.1.40.0030.00615.47
7.1.30.0030.01015.96
7.1.20.0100.00715.84
7.1.10.0100.00315.80
7.1.00.0040.04419.11
7.0.330.0030.01315.47
7.0.320.0030.00715.36
7.0.310.0120.00615.23
7.0.300.0070.01115.46
7.0.290.0090.00615.37
7.0.280.0060.00615.11
7.0.270.0060.00915.38
7.0.260.0160.00015.46
7.0.250.0030.00915.30
7.0.240.0060.00615.64
7.0.230.0000.00815.48
7.0.220.0000.01015.59
7.0.210.0050.00315.58
7.0.200.0040.00716.11
7.0.190.0070.00315.33
7.0.180.0070.01015.55
7.0.170.0030.01015.30
7.0.160.0100.00315.20
7.0.150.0000.00815.45
7.0.140.0030.04118.77
7.0.130.0100.00315.60
7.0.120.0070.00415.32
7.0.110.0040.01115.04
7.0.100.0030.00615.04
7.0.90.0060.00615.39
7.0.80.0070.00715.43
7.0.70.0000.00815.17
7.0.60.0120.04017.75
7.0.50.0050.03916.72
7.0.40.0070.04516.88
7.0.30.0130.03016.72
7.0.20.0120.03416.80
7.0.10.0020.04116.90
7.0.00.0090.02216.83
5.6.400.0090.00614.57
5.6.390.0000.01014.07
5.6.380.0030.01114.37
5.6.370.0100.01014.35
5.6.360.0060.01214.51
5.6.350.0000.01814.62
5.6.340.0070.00714.34
5.6.330.0140.00314.29
5.6.320.0080.00314.24
5.6.310.0000.01414.27
5.6.300.0080.00513.98
5.6.290.0000.00813.93
5.6.280.0030.04117.63
5.6.270.0030.00714.23
5.6.260.0060.00314.63
5.6.250.0060.00614.38
5.6.240.0070.01014.33
5.6.230.0040.00414.13
5.6.220.0000.01414.35
5.6.210.0030.04017.34
5.6.200.0100.04216.16
5.6.190.0050.02717.32
5.6.180.0320.04017.38
5.6.170.0210.03817.40
5.6.160.0030.02817.53
5.6.150.0080.04116.13
5.6.140.0050.04516.17
5.6.130.0100.02016.30
5.6.120.0080.03517.79
5.6.110.0100.04217.57
5.6.100.0050.04417.79
5.6.90.0150.03817.60
5.6.80.0040.02217.45
5.6.70.0060.00614.19
5.6.60.0040.01414.16
5.6.50.0030.01014.34
5.6.40.0070.00314.16
5.6.30.0030.01314.50
5.6.20.0070.00714.37
5.6.10.0090.00314.19
5.6.00.0040.01114.21
5.5.380.0030.00714.31
5.5.370.0030.01314.51
5.5.360.0080.00014.23
5.5.350.0180.03017.18
5.5.340.0030.02516.22
5.5.330.0090.04217.38
5.5.320.0270.03317.24
5.5.310.0150.04217.23
5.5.300.0040.03116.23
5.5.290.0040.02916.11
5.5.280.0150.03517.57
5.5.270.0050.02417.67
5.5.260.0030.04817.76
5.5.250.0060.03117.51
5.5.240.0010.02817.19
5.5.230.0000.01314.07
5.5.220.0030.01414.17
5.5.210.0070.01014.27
5.5.200.0040.01114.28
5.5.190.0040.00714.17
5.5.180.0070.00714.38
5.5.170.0030.01214.35
5.5.160.0040.00814.22
5.5.150.0090.00314.31
5.5.140.0030.00714.43
5.5.130.0030.01314.12
5.5.120.0060.00914.44
5.5.110.0030.01414.23
5.5.100.0060.00914.05
5.5.90.0040.00813.99
5.5.80.0030.01014.47
5.5.70.0040.00814.07
5.5.60.0070.00714.33
5.5.50.0040.00814.17
5.5.40.0090.00914.21
5.5.30.0000.01813.93
5.5.20.0040.01214.29
5.5.10.0040.01313.81
5.5.00.0110.00713.94
5.4.450.0480.02316.28
5.4.440.0220.03116.20
5.4.430.0170.03716.26
5.4.420.0190.04016.13
5.4.410.0270.04016.13
5.4.400.0340.03215.89
5.4.390.0530.03515.91
5.4.380.0150.02715.78
5.4.370.0110.02815.80
5.4.360.0070.03315.85
5.4.350.0100.03115.88
5.4.340.0100.03015.76
5.4.330.0060.00612.95
5.4.320.0080.02512.73
5.4.310.0080.02812.73
5.4.300.0060.02212.73
5.4.290.0020.02412.73
5.4.280.0040.02012.68
5.4.270.0020.02612.66
5.4.260.0050.02312.66
5.4.250.0050.02212.66
5.4.240.0050.02312.66
5.4.230.0040.02212.66
5.4.220.0050.02212.65
5.4.210.0050.02112.65
5.4.200.0020.02612.66
5.4.190.0040.02012.66
5.4.180.0020.02512.65
5.4.170.0030.02312.66
5.4.160.0050.02312.66
5.4.150.0050.02112.66
5.4.140.0080.02012.50
5.4.130.0030.02212.49
5.4.120.0060.01912.47
5.4.110.0070.01912.47
5.4.100.0040.02412.47
5.4.90.0080.01812.47
5.4.80.0040.02312.47
5.4.70.0050.02212.47
5.4.60.0030.02012.47
5.4.50.0040.02212.46
5.4.40.0020.02112.46
5.4.30.0070.01812.46
5.4.20.0020.02312.46
5.4.10.0040.02212.46
5.4.00.0040.02612.20
5.3.290.0060.02312.88
5.3.280.0060.02612.83
5.3.270.0060.02112.83
5.3.260.0040.03112.84
5.3.250.0050.02212.83
5.3.240.0040.02212.83
5.3.230.0040.02312.83
5.3.220.0050.02112.82
5.3.210.0030.02212.81
5.3.200.0060.02312.82
5.3.190.0040.02412.81
5.3.180.0070.02012.81
5.3.170.0070.01912.81
5.3.160.0030.02612.81
5.3.150.0050.02112.81
5.3.140.0040.02212.80
5.3.130.0020.02512.80
5.3.120.0050.02212.80
5.3.110.0030.02712.80
5.3.100.0060.02312.53
5.3.90.0060.02712.52
5.3.80.0050.02112.51
5.3.70.0050.02812.51
5.3.60.0040.02612.51
5.3.50.0070.02612.47
5.3.40.0080.02012.47
5.3.30.0040.03012.45
5.3.20.0010.02312.34
5.3.10.0040.02312.32
5.3.00.0040.02012.31
5.2.170.0040.0319.17
5.2.160.0060.0289.17
5.2.150.0040.0319.17
5.2.140.0040.0309.17
5.2.130.0060.0279.13
5.2.120.0060.0279.13
5.2.110.0040.0319.14
5.2.100.0070.0269.13
5.2.90.0050.0299.13
5.2.80.0020.0339.13
5.2.70.0040.0329.13
5.2.60.0090.0339.08
5.2.50.0120.0389.05
5.2.40.0070.0399.03
5.2.30.0040.0449.00
5.2.20.0040.0429.00
5.2.10.0060.0398.91
5.2.00.0100.0368.77
5.1.60.0050.0338.04
5.1.50.0090.0298.04
5.1.40.0060.0478.03
5.1.30.0060.0438.38
5.1.20.0070.0408.41
5.1.10.0050.0368.13
5.1.00.0030.0268.12
5.0.50.0050.0186.60
5.0.40.0020.0206.46
5.0.30.0050.0296.27
5.0.20.0030.0196.25
5.0.10.0020.0206.21
5.0.00.0040.0306.21
4.4.90.0020.0164.78
4.4.80.0020.0154.76
4.4.70.0040.0144.76
4.4.60.0040.0144.75
4.4.50.0010.0174.77
4.4.40.0020.0264.71
4.4.30.0040.0154.76
4.4.20.0010.0174.85
4.4.10.0040.0144.84
4.4.00.0020.0254.76
4.3.110.0030.0154.67
4.3.100.0050.0124.66
4.3.90.0020.0154.63
4.3.80.0060.0214.58
4.3.70.0020.0154.63
4.3.60.0020.0154.63
4.3.50.0010.0174.63
4.3.40.0040.0234.54
4.3.30.0030.0153.28
4.3.20.0010.0173.27
4.3.10.0020.0153.23
4.3.00.0100.0237.26

preferences:
52.16 ms | 400 KiB | 5 Q