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.40.0090.00918.82
8.3.30.0070.00719.13
8.3.20.0040.01120.25
8.3.10.0000.00821.89
8.3.00.0030.00522.47
8.2.170.0070.00722.96
8.2.160.0140.00020.43
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00019.26
8.2.110.0090.00022.07
8.2.100.0040.00817.50
8.2.90.0000.00819.09
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0040.00417.91
8.2.50.0040.00718.07
8.2.40.0080.00018.22
8.2.30.0050.00217.88
8.2.20.0000.00817.70
8.2.10.0030.00619.46
8.2.00.0040.00417.55
8.1.270.0040.00422.14
8.1.260.0050.00326.35
8.1.250.0000.01028.09
8.1.240.0090.00023.62
8.1.230.0140.00320.98
8.1.220.0080.00018.39
8.1.210.0040.00418.77
8.1.200.0060.00317.34
8.1.190.0080.00017.53
8.1.180.0040.00418.10
8.1.170.0030.00518.57
8.1.160.0040.00422.00
8.1.150.0040.00418.64
8.1.140.0040.00417.37
8.1.130.0000.00717.92
8.1.120.0040.00417.40
8.1.110.0000.00717.41
8.1.100.0000.00717.44
8.1.90.0000.00717.39
8.1.80.0040.00317.42
8.1.70.0070.00017.40
8.1.60.0060.00317.54
8.1.50.0000.00717.54
8.1.40.0040.00417.41
8.1.30.0000.00817.61
8.1.20.0030.00517.54
8.1.10.0070.00317.56
8.1.00.0070.00017.39
8.0.300.0000.00718.77
8.0.290.0070.00017.16
8.0.280.0030.00318.29
8.0.270.0000.00717.06
8.0.260.0030.00316.76
8.0.250.0030.00316.96
8.0.240.0050.00316.84
8.0.230.0000.00916.95
8.0.220.0040.00416.91
8.0.210.0000.00716.86
8.0.200.0000.00716.93
8.0.190.0080.00016.83
8.0.180.0000.00816.83
8.0.170.0080.00016.96
8.0.160.0070.00016.95
8.0.150.0000.00716.88
8.0.140.0040.00416.87
8.0.130.0030.00313.34
8.0.120.0030.00516.76
8.0.110.0040.00416.79
8.0.100.0040.00416.70
8.0.90.0000.00716.76
8.0.80.0060.01116.81
8.0.70.0040.00416.96
8.0.60.0040.00416.67
8.0.50.0040.00416.82
8.0.30.0060.01717.05
8.0.20.0080.01117.40
8.0.10.0000.00917.12
8.0.00.0100.00816.87
7.4.330.0020.00215.14
7.4.320.0030.00316.55
7.4.300.0040.00416.55
7.4.290.0000.00816.60
7.4.280.0040.00416.50
7.4.270.0050.00316.50
7.4.260.0030.00616.57
7.4.250.0040.00416.55
7.4.240.0060.00116.46
7.4.230.0000.00716.40
7.4.220.0030.01316.54
7.4.210.0070.01016.46
7.4.200.0050.00316.52
7.4.190.0030.00316.64
7.4.160.0080.00816.54
7.4.150.0070.01017.40
7.4.140.0130.00517.86
7.4.130.0090.01116.53
7.4.120.0110.00616.55
7.4.110.0120.00416.50
7.4.100.0060.01216.59
7.4.90.0130.00616.50
7.4.80.0090.01419.39
7.4.70.0110.00616.45
7.4.60.0040.01416.43
7.4.50.0000.00816.29
7.4.40.0080.00622.77
7.4.30.0050.01116.49
7.4.10.0130.00615.00
7.4.00.0020.01314.97
7.3.330.0050.00013.22
7.3.320.0000.00513.43
7.3.310.0070.00016.25
7.3.300.0070.00016.28
7.3.290.0000.02016.43
7.3.280.0090.00816.36
7.3.270.0180.00617.40
7.3.260.0120.00616.36
7.3.250.0150.00516.47
7.3.240.0040.01216.42
7.3.230.0040.01716.39
7.3.210.0030.01316.35
7.3.200.0060.01119.39
7.3.190.0060.01216.50
7.3.180.0030.01316.39
7.3.170.0060.01616.37
7.3.160.0070.00716.30
7.3.130.0070.01014.75
7.3.120.0050.01114.80
7.3.110.0070.01014.85
7.3.100.0090.00314.86
7.3.90.0060.00614.71
7.3.80.0080.00414.83
7.3.70.0060.00914.56
7.3.60.0120.00314.68
7.3.50.0000.01114.54
7.3.40.0060.00914.64
7.3.30.0040.01114.78
7.3.20.0120.00616.47
7.3.10.0030.01516.65
7.3.00.0000.01616.51
7.2.330.0060.01116.43
7.2.320.0120.00816.50
7.2.310.0110.01116.67
7.2.300.0070.01016.53
7.2.290.0030.01316.45
7.2.260.0070.01014.89
7.2.250.0070.01015.17
7.2.240.0030.01015.11
7.2.230.0030.01314.89
7.2.220.0100.00714.77
7.2.210.0030.01014.80
7.2.200.0040.01214.98
7.2.190.0030.00715.10
7.2.180.0120.00315.08
7.2.170.0030.01214.93
7.2.160.0070.00714.99
7.2.150.0070.00716.81
7.2.140.0000.01216.76
7.2.130.0070.01116.52
7.2.120.0100.00316.86
7.2.110.0060.00916.70
7.2.100.0030.00916.78
7.2.90.0030.00916.91
7.2.80.0060.00617.00
7.2.70.0060.00616.78
7.2.60.0040.00816.74
7.2.50.0090.00616.66
7.2.40.0000.01617.04
7.2.30.0030.00616.75
7.2.20.0090.00316.75
7.2.10.0110.00416.53
7.2.00.0050.01017.91
7.1.330.0060.00915.52
7.1.320.0030.01015.83
7.1.310.0040.00715.55
7.1.300.0000.00815.66
7.1.290.0040.00415.70
7.1.280.0040.00815.64
7.1.270.0060.00915.59
7.1.260.0000.01715.65
7.1.250.0130.00015.79
7.1.240.0030.00715.62
7.1.230.0050.00515.72
7.1.220.0000.01615.70
7.1.210.0070.00315.39
7.1.200.0020.01015.59
7.1.190.0060.00615.69
7.1.180.0080.00315.62
7.1.170.0000.01215.53
7.1.160.0030.00915.72
7.1.150.0040.00415.61
7.1.140.0030.01215.72
7.1.130.0040.01115.68
7.1.120.0070.00715.72
7.1.110.0060.00915.64
7.1.100.0050.00816.74
7.1.90.0040.01115.67
7.1.80.0040.00715.45
7.1.70.0030.00716.44
7.1.60.0150.00517.73
7.1.50.0070.00616.30
7.1.40.0030.00615.63
7.1.30.0030.00615.70
7.1.20.0070.00715.58
7.1.10.0070.00715.60
7.1.00.0000.04418.87
7.0.330.0040.00815.30
7.0.320.0070.00715.10
7.0.310.0070.00715.28
7.0.300.0080.00515.05
7.0.290.0060.00815.33
7.0.280.0050.00515.04
7.0.270.0000.00815.36
7.0.260.0070.00715.23
7.0.250.0040.00415.39
7.0.240.0060.00615.14
7.0.230.0030.00615.30
7.0.220.0000.00815.36
7.0.210.0030.00915.45
7.0.200.0080.00516.12
7.0.190.0030.00515.29
7.0.180.0030.01015.18
7.0.170.0030.01415.30
7.0.160.0110.00415.41
7.0.150.0060.00915.28
7.0.140.0000.04418.56
7.0.130.0070.00714.95
7.0.120.0060.00615.26
7.0.110.0000.01415.21
7.0.100.0050.00515.30
7.0.90.0000.01715.24
7.0.80.0140.00015.16
7.0.70.0070.00315.09
7.0.60.0090.04317.69
7.0.50.0040.04316.66
7.0.40.0020.03116.77
7.0.30.0150.03716.88
7.0.20.0180.04116.84
7.0.10.0170.04316.78
7.0.00.0020.05216.79
5.6.400.0060.00614.36
5.6.390.0030.00914.60
5.6.380.0040.01114.48
5.6.370.0110.00313.93
5.6.360.0000.01514.57
5.6.350.0090.00314.64
5.6.340.0060.00614.56
5.6.330.0030.00914.36
5.6.320.0060.00614.59
5.6.310.0130.00314.31
5.6.300.0060.00614.13
5.6.290.0040.01114.53
5.6.280.0080.03517.57
5.6.270.0000.01514.26
5.6.260.0000.00814.26
5.6.250.0040.00813.96
5.6.240.0000.01414.41
5.6.230.0120.00314.14
5.6.220.0060.01214.24
5.6.210.0050.02317.34
5.6.200.0050.04216.23
5.6.190.0080.03817.49
5.6.180.2110.02517.43
5.6.170.0190.03517.24
5.6.160.0060.04317.36
5.6.150.0070.02216.37
5.6.140.0030.02616.33
5.6.130.0030.02516.21
5.6.120.0120.03817.47
5.6.110.0050.03517.56
5.6.100.0060.04117.72
5.6.90.0030.02917.85
5.6.80.0060.02417.32
5.6.70.0160.03317.36
5.6.60.0030.01414.27
5.6.50.0040.00714.27
5.6.40.0000.00914.04
5.6.30.0060.00914.16
5.6.20.0080.00814.49
5.6.10.0060.00314.27
5.6.00.0130.00014.10
5.5.380.0060.00614.17
5.5.370.0080.00414.55
5.5.360.0030.01014.14
5.5.350.0080.03217.22
5.5.340.0060.03116.06
5.5.330.0070.03117.24
5.5.320.0160.01917.39
5.5.310.0180.04117.25
5.5.300.0090.02616.02
5.5.290.0100.02916.07
5.5.280.0020.04117.44
5.5.270.0070.03817.32
5.5.260.0040.02517.56
5.5.250.0030.02717.34
5.5.240.0050.04117.21
5.5.230.0040.01114.25
5.5.220.0080.00814.13
5.5.210.0030.01014.20
5.5.200.0130.00013.85
5.5.190.0030.01314.00
5.5.180.0040.00813.93
5.5.170.0030.00514.18
5.5.160.0000.00913.94
5.5.150.0000.01214.14
5.5.140.0030.00914.27
5.5.130.0030.01014.32
5.5.120.0040.00714.27
5.5.110.0030.01014.30
5.5.100.0030.00914.23
5.5.90.0030.00614.08
5.5.80.0040.01114.26
5.5.70.0040.01114.20
5.5.60.0070.00714.00
5.5.50.0080.00814.29
5.5.40.0000.01214.05
5.5.30.0070.00713.95
5.5.20.0070.00714.22
5.5.10.0000.01314.19
5.5.00.0080.00014.22
5.4.450.0150.02615.69
5.4.440.0050.03515.77
5.4.430.0100.02715.70
5.4.420.0050.03615.76
5.4.410.0030.03315.75
5.4.400.0380.00515.42
5.4.390.0580.00215.41
5.4.380.0100.03315.42
5.4.370.0110.02615.34
5.4.360.0160.02115.43
5.4.350.0090.03315.41
5.4.340.0080.02915.46
5.4.330.0030.00912.08
5.4.320.0030.02612.30
5.4.310.0040.02412.29
5.4.300.0030.02912.30
5.4.290.0090.02112.29
5.4.280.0070.02612.24
5.4.270.0050.04315.49
5.4.260.0050.03815.43
5.4.250.0130.02715.39
5.4.240.0070.03015.44
5.4.230.0000.04415.51
5.4.220.0050.03815.44
5.4.210.0130.03515.49
5.4.200.0080.03015.50
5.4.190.0040.03415.57
5.4.180.0050.02815.44
5.4.170.0070.03815.49
5.4.160.0050.02915.35
5.4.150.0080.03115.34
5.4.140.0050.02914.24
5.4.130.0100.02514.30
5.4.120.0080.03814.25
5.4.110.0030.03214.29
5.4.100.0020.03614.22
5.4.90.0030.03114.25
5.4.80.0020.03214.28
5.4.70.0110.03314.22
5.4.60.0060.03214.25
5.4.50.0060.03514.18
5.4.40.0100.02714.27
5.4.30.0040.03214.19
5.4.20.0020.04114.26
5.4.10.0080.03314.21
5.4.00.0070.03513.96
5.3.290.0070.02512.44
5.3.280.0140.03313.38
5.3.270.0050.03313.44
5.3.260.0050.03713.39
5.3.250.0070.03713.36
5.3.240.0050.02913.35
5.3.230.0080.03113.44
5.3.220.0050.02813.32
5.3.210.0050.02613.43
5.3.200.0030.04413.37
5.3.190.0180.01513.32
5.3.180.0070.02713.37
5.3.170.0110.03613.37
5.3.160.0030.03013.34
5.3.150.0070.04013.40
5.3.140.0050.02613.32
5.3.130.0030.03713.36
5.3.120.0030.02813.35
5.3.110.0080.02913.31
5.3.100.0050.02813.06
5.3.90.0060.03213.09
5.3.80.0070.02813.10
5.3.70.0070.02913.05
5.3.60.0110.03513.09
5.3.50.0020.03313.03
5.3.40.0080.02513.06
5.3.30.0080.03113.11
5.3.20.0090.02912.93
5.3.10.0040.03212.87
5.3.00.0070.02512.86
5.2.170.0000.06311.11
5.2.160.0070.03710.97
5.2.150.0000.06311.22
5.2.140.0030.06011.14
5.2.130.0070.05311.18
5.2.120.0100.04311.07
5.2.110.0030.05711.05
5.2.100.0070.05311.00
5.2.90.0130.04711.08
5.2.80.0130.04011.09
5.2.70.0000.04311.17
5.2.60.0030.06011.12
5.2.50.0100.05311.11
5.2.40.0130.03011.08
5.2.30.0100.03710.96
5.2.20.0100.04010.96
5.2.10.0030.04010.85
5.2.00.0030.05010.64
5.1.60.0030.0509.84
5.1.50.0030.03710.00
5.1.40.0100.0309.97
5.1.30.0030.03710.39
5.1.20.0070.04010.43
5.1.10.0070.03310.22
5.1.00.0030.04310.05
5.0.50.0030.0308.57
5.0.40.0000.0308.50
5.0.30.0030.0478.20
5.0.20.0100.0238.03
5.0.10.0070.0238.32
5.0.00.0000.0478.21
4.4.90.0030.0207.20
4.4.80.0070.0237.20
4.4.70.0070.0237.20
4.4.60.0030.0207.20
4.4.50.0030.0237.20
4.4.40.0000.0337.20
4.4.30.0100.0207.20
4.4.20.0000.0337.20
4.4.10.0030.0207.20
4.4.00.0000.0377.20
4.3.110.0030.0307.20
4.3.100.0030.0307.20
4.3.90.0000.0277.20
4.3.80.0070.0437.20
4.3.70.0070.0237.20
4.3.60.0030.0307.20
4.3.50.0000.0277.20
4.3.40.0030.0337.20
4.3.30.0000.0277.20
4.3.20.0070.0177.20
4.3.10.0000.0237.20
4.3.00.0070.0175.94

preferences:
44.64 ms | 400 KiB | 5 Q