3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $is_call = false; public function getFunc() { return function($str) use (&$enable) { if ($this->is_call) { echo $str; } }; } public function run() { $this->is_call = true; $func = $this->getFunc(); $func('ok'); echo PHP_EOL.'---------------'.PHP_EOL; $this->is_call = false; $func('not ok'); $this->is_call = 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.0070.01118.43
8.3.50.0070.01221.15
8.3.40.0000.01418.96
8.3.30.0100.01019.05
8.3.20.0030.00620.21
8.3.10.0040.01121.92
8.3.00.0000.00822.39
8.2.180.0070.01416.32
8.2.170.0070.00722.96
8.2.160.0100.01019.21
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0120.00326.16
8.2.120.0050.00319.54
8.2.110.0000.00822.25
8.2.100.0070.00418.98
8.2.90.0000.00818.88
8.2.80.0040.00419.41
8.2.70.0030.00617.63
8.2.60.0080.00317.91
8.2.50.0000.00818.07
8.2.40.0080.00018.22
8.2.30.0000.00818.07
8.2.20.0060.00417.60
8.2.10.0000.00817.68
8.2.00.0050.00217.62
8.1.280.0060.01625.92
8.1.270.0060.00318.53
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.54
8.1.230.0060.00619.22
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0090.00017.41
8.1.180.0030.00520.54
8.1.170.0060.00318.49
8.1.160.0030.00522.16
8.1.150.0040.00418.64
8.1.140.0040.00417.38
8.1.130.0030.00317.75
8.1.120.0040.00417.39
8.1.110.0070.00317.46
8.1.100.0050.00317.50
8.1.90.0040.00717.50
8.1.80.0070.00017.41
8.1.70.0000.00717.44
8.1.60.0060.00317.61
8.1.50.0040.00417.43
8.1.40.0040.00417.43
8.1.30.0030.00617.67
8.1.20.0030.00617.72
8.1.10.0060.00317.59
8.1.00.0040.00417.38
8.0.300.0040.00418.77
8.0.290.0000.00917.30
8.0.280.0030.00318.44
8.0.270.0040.00417.32
8.0.260.0080.00016.77
8.0.250.0030.00316.95
8.0.240.0060.00316.97
8.0.230.0080.00016.91
8.0.220.0000.00716.80
8.0.210.0070.00016.91
8.0.200.0030.00316.86
8.0.190.0040.00716.89
8.0.180.0070.00016.93
8.0.170.0040.00416.91
8.0.160.0000.00716.83
8.0.150.0040.00416.80
8.0.140.0000.00816.91
8.0.130.0030.00313.32
8.0.120.0040.00416.75
8.0.110.0040.00416.84
8.0.100.0040.00416.77
8.0.90.0050.00316.74
8.0.80.0070.01416.84
8.0.70.0040.00416.93
8.0.60.0050.00216.72
8.0.50.0080.00016.72
8.0.30.0140.00916.97
8.0.20.0120.00617.44
8.0.10.0050.00216.99
8.0.00.0080.00916.95
7.4.330.0050.00015.00
7.4.320.0060.00016.43
7.4.300.0060.00016.48
7.4.290.0000.00716.49
7.4.280.0040.00416.46
7.4.270.0000.00616.46
7.4.260.0100.00016.59
7.4.250.0040.00416.57
7.4.240.0020.00516.51
7.4.230.0030.00316.61
7.4.220.0130.00716.61
7.4.210.0070.00916.53
7.4.200.0040.00416.25
7.4.190.0030.00616.45
7.4.160.0130.00316.45
7.4.150.0140.00417.40
7.4.140.0080.01317.86
7.4.130.0120.00416.51
7.4.120.0080.00916.38
7.4.110.0070.01016.45
7.4.100.0070.01016.59
7.4.90.0060.01116.61
7.4.80.0100.01319.39
7.4.70.0120.00616.56
7.4.60.0080.00816.38
7.4.50.0040.00016.66
7.4.40.0060.00922.77
7.4.30.0080.00816.42
7.4.00.0090.00615.11
7.3.330.0060.00013.38
7.3.320.0030.00313.37
7.3.310.0030.00316.15
7.3.300.0070.00016.26
7.3.290.0120.00316.39
7.3.280.0110.00516.27
7.3.270.0130.00617.40
7.3.260.0120.00516.30
7.3.250.0100.01016.53
7.3.240.0030.01316.41
7.3.230.0140.00316.49
7.3.210.0090.00916.39
7.3.200.0130.00619.39
7.3.190.0110.00916.36
7.3.180.0070.01016.34
7.3.170.0090.00816.47
7.3.160.0190.00316.66
7.3.120.0030.01215.12
7.3.10.0070.00716.51
7.3.00.0050.00916.65
7.2.330.0100.00716.64
7.2.320.0130.00616.76
7.2.310.0160.00616.82
7.2.300.0120.00916.77
7.2.290.0110.00516.56
7.2.130.0050.01116.81
7.2.120.0050.00816.72
7.2.110.0100.00516.72
7.2.100.0040.00916.87
7.2.90.0060.00816.97
7.2.80.0070.00716.66
7.2.70.0040.00916.91
7.2.60.0050.00816.84
7.2.50.0050.00916.91
7.2.40.0090.00616.94
7.2.30.0060.00916.81
7.2.20.0070.00816.83
7.2.10.0030.00716.91
7.2.00.0060.00817.56
7.1.250.0100.00715.67
7.1.240.0060.00315.45
7.1.230.0060.00815.65
7.1.220.0120.00015.70
7.1.210.0030.01115.71
7.1.200.0090.00515.49
7.1.190.0090.00315.80
7.1.180.0070.00615.79
7.1.170.0040.00815.76
7.1.160.0050.00515.69
7.1.150.0050.00515.66
7.1.140.0090.00715.78
7.1.130.0090.00515.59
7.1.120.0020.01215.73
7.1.110.0010.00915.48
7.1.100.0060.00615.68
7.1.90.0060.00615.69
7.1.80.0070.00715.65
7.1.70.0030.00816.10
7.1.60.0040.00916.21
7.1.50.0040.01216.14
7.1.40.0050.00815.91
7.1.30.0040.00715.46
7.1.20.0040.00915.64
7.1.10.0080.00515.61
7.1.00.0040.01817.88
7.0.330.0010.00915.24
7.0.320.0070.00915.33
7.0.310.0110.00315.38
7.0.300.0080.00515.37
7.0.290.0090.00315.37
7.0.280.0030.00715.48
7.0.270.0090.00515.29
7.0.260.0100.00515.49
7.0.250.0040.01115.23
7.0.240.0050.00915.49
7.0.230.0060.00615.11
7.0.220.0060.00515.11
7.0.210.0050.00815.32
7.0.200.0060.00815.79
7.0.190.0000.01215.27
7.0.180.0070.00615.24
7.0.170.0020.01215.33
7.0.160.0000.01215.29
7.0.150.0060.00415.44
7.0.140.0040.02917.51
7.0.130.0020.01015.51
7.0.120.0010.00715.56
7.0.110.0030.01015.26
7.0.100.0040.00715.37
7.0.90.0050.00715.39
7.0.80.0070.00515.22
7.0.70.0050.00615.45
7.0.60.0090.02916.94
7.0.50.0060.01816.34
7.0.40.0060.03415.68
7.0.30.0210.02115.37
7.0.20.0130.03015.69
7.0.10.0020.02315.72
7.0.00.0010.03715.82
5.6.380.0080.00314.51
5.6.370.0020.01014.34
5.6.360.0060.00614.45
5.6.350.0080.00414.59
5.6.340.0020.00914.13
5.6.330.0050.00614.43
5.6.320.0050.00714.48
5.6.310.0090.00414.25
5.6.300.0060.00814.45
5.6.290.0060.00414.18
5.6.280.0010.02916.46
5.6.270.0060.00714.36
5.6.260.0060.00614.33
5.6.250.0070.00614.36
5.6.240.0060.00614.50
5.6.230.0050.00814.30
5.6.220.0020.01214.20
5.6.210.0040.02316.32
5.6.200.0090.03015.46
5.6.190.0050.01816.40
5.6.180.0090.02716.34
5.6.170.0130.02316.22
5.6.160.0110.02516.39
5.6.150.0040.02315.49
5.6.140.0070.02215.69
5.6.130.0100.02715.47
5.6.120.0030.03616.59
5.6.110.0030.03816.54
5.6.100.0100.03116.51
5.6.90.0090.03016.58
5.6.80.0070.02216.27
5.6.70.0100.00314.29
5.6.60.0050.00814.37
5.6.50.0020.00914.11
5.6.40.0080.00714.32
5.6.30.0060.00614.14
5.6.20.0050.00914.23
5.6.10.0020.01214.38
5.6.00.0070.00714.21
5.5.380.0060.00511.18
5.5.370.0040.00711.28
5.5.360.0030.00811.32
5.5.350.0050.03114.26
5.5.340.0050.02113.46
5.5.330.0050.03114.29
5.5.320.1080.01414.30
5.5.310.0160.02714.19
5.5.300.0030.02613.48
5.5.290.0020.03613.37
5.5.280.0070.02714.51
5.5.270.0090.02914.39
5.5.260.0060.03114.58
5.5.250.0040.03214.25
5.5.240.0040.03014.08
5.5.230.0030.00811.03
5.5.220.0020.00710.89
5.5.210.0000.01011.23
5.5.200.0040.00811.17
5.5.190.0030.00710.95
5.5.180.0030.00711.13
5.5.170.0020.00711.24
5.5.160.0020.00611.22
5.5.150.0030.01011.01
5.5.140.0020.01010.86
5.5.130.0050.00511.04
5.5.120.0040.00611.07
5.5.110.0040.00610.96
5.5.100.0040.00411.29
5.5.90.0030.00811.03
5.5.80.0040.00411.00
5.5.70.0020.00711.29
5.5.60.0040.00411.26
5.5.50.0060.00311.22
5.5.40.0030.00611.04
5.5.30.0030.00810.97
5.5.20.0020.00711.19
5.5.10.0100.00011.11
5.5.00.0050.00410.99
5.4.450.0120.01713.77
5.4.440.0080.02213.95
5.4.430.0370.02213.83
5.4.420.0070.02813.76
5.4.410.0080.02013.84
5.4.400.0010.02513.84
5.4.390.0060.02013.52
5.4.380.0070.02113.59
5.4.370.0100.01813.46
5.4.360.0060.02213.49
5.4.350.0030.01811.36
5.4.340.0040.01611.41
5.4.330.0040.00710.88
5.4.320.0050.01611.49
5.4.310.0050.01511.59
5.4.300.0040.01711.46
5.4.290.0070.01711.52
5.4.280.0020.01911.46
5.4.270.0040.02213.54
5.4.260.0070.01913.60
5.4.250.0030.02613.49
5.4.240.0080.01913.50
5.4.230.0090.02413.67
5.4.220.0050.02113.63
5.4.210.0050.02513.71
5.4.200.0040.02013.64
5.4.190.0060.02613.57
5.4.180.0060.02313.76
5.4.170.0020.03013.53
5.4.160.0060.01913.61
5.4.150.0050.02913.42
5.4.140.0080.01812.87
5.4.130.0050.02012.83
5.4.120.0060.01912.90
5.4.110.0040.02312.94
5.4.100.0040.02012.85
5.4.90.0060.01912.89
5.4.80.0090.02112.98
5.4.70.0050.02112.85
5.4.60.0050.02112.94
5.4.50.0060.02012.82
5.4.40.0050.01912.81
5.4.30.0060.02512.93
5.4.20.0060.01912.79
5.4.10.0060.01912.90
5.4.00.0060.02012.57
5.3.290.0030.01911.38
5.3.280.0090.02312.05
5.3.270.0060.02212.11
5.3.260.0050.02912.07
5.3.250.0010.02212.02
5.3.240.0050.01812.08
5.3.230.0050.02112.01
5.3.220.0060.01812.02
5.3.210.0070.02712.06
5.3.200.0070.02012.03
5.3.190.0080.01811.99
5.3.180.0090.02011.97
5.3.170.0090.02311.99
5.3.160.0040.02112.04
5.3.150.0080.02612.06
5.3.140.0060.02011.98
5.3.130.0060.02112.08
5.3.120.0070.02011.98
5.3.110.0060.02111.96
5.3.100.0040.01911.84
5.3.90.0050.02011.90
5.3.80.0100.01711.86
5.3.70.0060.01611.83
5.3.60.0010.02411.86
5.3.50.0090.02211.89
5.3.40.0060.01911.83
5.3.30.0020.02211.72
5.3.20.0050.01911.72
5.3.10.0020.02911.69
5.3.00.0040.02211.61
5.2.170.0050.01510.45
5.2.160.0060.01710.40
5.2.150.0040.02210.45
5.2.140.0020.01910.43
5.2.130.0030.01810.40
5.2.120.0060.02110.38
5.2.110.0060.02010.39
5.2.100.0030.02410.41
5.2.90.0030.02310.45
5.2.80.0060.02010.44
5.2.70.0090.01710.34
5.2.60.0030.02410.32
5.2.50.0040.01410.46
5.2.40.0050.01910.38
5.2.30.0070.01310.31
5.2.20.0030.01710.24
5.2.10.0020.01810.29
5.2.00.0020.01710.22
5.1.60.0050.0129.77
5.1.50.0050.0129.70
5.1.40.0030.0139.80
5.1.30.0030.0169.90
5.1.20.0010.0189.81
5.1.10.0050.0189.80
5.1.00.0010.0179.78
5.0.50.0010.0149.15
5.0.40.0040.0149.19
5.0.30.0030.0159.08
5.0.20.0020.0139.08
5.0.10.0030.0159.06
5.0.00.0050.0149.15
4.4.90.0040.0098.75
4.4.80.0010.0118.75
4.4.70.0010.0118.75
4.4.60.0020.0098.75
4.4.50.0030.0128.75
4.4.40.0030.0138.75
4.4.30.0030.0098.75
4.4.20.0030.0078.75
4.4.10.0010.0108.75
4.4.00.0010.0158.75
4.3.110.0000.0118.75
4.3.100.0030.0118.75
4.3.90.0050.0088.75
4.3.80.0020.0168.75
4.3.70.0010.0108.75
4.3.60.0010.0108.75
4.3.50.0010.0138.75
4.3.40.0040.0128.75
4.3.30.0020.0108.75
4.3.20.0010.0138.75
4.3.10.0030.0088.75
4.3.00.0100.00811.19

preferences:
40.97 ms | 401 KiB | 5 Q