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() { $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.0130.00616.50
8.3.50.0120.01021.98
8.3.40.0090.00618.82
8.3.30.0070.00719.22
8.3.20.0090.00020.22
8.3.10.0000.00823.50
8.3.00.0030.00722.47
8.2.180.0140.00716.63
8.2.170.0120.00622.96
8.2.160.0070.01320.47
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00419.95
8.2.110.0100.00022.10
8.2.100.0090.00317.91
8.2.90.0000.00919.21
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0080.00017.80
8.2.50.0040.00418.07
8.2.40.0000.00818.28
8.2.30.0050.00218.08
8.2.20.0000.00717.73
8.2.10.0070.00017.63
8.2.00.0000.00717.67
8.1.280.0140.00725.92
8.1.270.0070.00722.20
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00423.71
8.1.230.0000.01119.06
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0040.00417.35
8.1.190.0050.00317.53
8.1.180.0040.00418.10
8.1.170.0070.00518.25
8.1.160.0070.00022.07
8.1.150.0000.00818.57
8.1.140.0000.00717.48
8.1.130.0040.00417.75
8.1.120.0030.00317.50
8.1.110.0000.00717.36
8.1.100.0040.00417.36
8.1.90.0040.00417.46
8.1.80.0040.00417.36
8.1.70.0070.00017.41
8.1.60.0050.00317.64
8.1.50.0040.00417.52
8.1.40.0000.00817.52
8.1.30.0000.00817.64
8.1.20.0040.00417.70
8.1.10.0060.00317.58
8.1.00.0040.00417.46
8.0.300.0070.00018.77
8.0.290.0040.00417.18
8.0.280.0030.00318.39
8.0.270.0040.00417.26
8.0.260.0000.00716.88
8.0.250.0030.00716.84
8.0.240.0030.00316.85
8.0.230.0030.00316.83
8.0.220.0030.00316.77
8.0.210.0070.00016.90
8.0.200.0040.00416.96
8.0.190.0040.00716.92
8.0.180.0030.00316.94
8.0.170.0000.00816.82
8.0.160.0000.00716.94
8.0.150.0040.00416.77
8.0.140.0070.00016.72
8.0.130.0000.00613.38
8.0.120.0050.00216.77
8.0.110.0000.00716.87
8.0.100.0000.00716.85
8.0.90.0000.00716.94
8.0.80.0090.00616.80
8.0.70.0050.00216.92
8.0.60.0040.00416.88
8.0.50.0040.00416.85
8.0.30.0130.00617.17
8.0.20.0130.00517.40
8.0.10.0070.00016.84
8.0.00.0080.01216.79
7.4.330.0020.00215.05
7.4.320.0000.00616.50
7.4.300.0000.00616.61
7.4.290.0070.00016.46
7.4.280.0060.00516.60
7.4.270.0060.00016.42
7.4.260.0070.00016.60
7.4.250.0040.00416.46
7.4.240.0020.00516.57
7.4.230.0000.00716.66
7.4.220.0120.00616.53
7.4.210.0090.00916.54
7.4.200.0000.00716.63
7.4.190.0070.00016.67
7.4.160.0100.00716.63
7.4.150.0100.00717.40
7.4.140.0050.01217.86
7.4.130.0070.00916.62
7.4.120.0070.01016.47
7.4.110.0110.00516.49
7.4.100.0000.01716.58
7.4.90.0090.00916.67
7.4.80.0100.00716.53
7.4.70.0160.00016.50
7.4.60.0060.01016.34
7.4.50.0030.00616.66
7.4.40.0000.01422.77
7.4.30.0090.01216.53
7.4.00.0060.01114.96
7.3.330.0050.00013.27
7.3.320.0030.00313.23
7.3.310.0030.00516.30
7.3.300.0040.00416.32
7.3.290.0100.00316.36
7.3.280.0090.00716.31
7.3.270.0110.00717.40
7.3.260.0150.00616.30
7.3.250.0070.01216.44
7.3.240.0100.01316.44
7.3.230.0100.00616.39
7.3.210.0080.00916.61
7.3.200.0100.01019.39
7.3.190.0250.02016.44
7.3.180.0070.01016.25
7.3.170.0000.01616.63
7.3.160.0040.01216.53
7.3.120.0090.00714.97
7.3.110.0130.00314.94
7.3.100.0040.00814.84
7.3.90.0090.00615.00
7.3.80.0110.00314.79
7.3.70.0100.00314.44
7.3.60.0060.01014.92
7.3.50.0060.00314.70
7.3.40.0070.00714.54
7.3.30.0060.00614.81
7.3.20.0030.01016.35
7.3.10.0030.01016.58
7.3.00.0090.00616.63
7.2.330.0060.01216.75
7.2.320.0060.01816.71
7.2.310.0060.01816.83
7.2.300.0100.00716.93
7.2.290.0120.00916.47
7.2.250.0090.00914.71
7.2.240.0090.00915.23
7.2.230.0060.01014.80
7.2.220.0130.00015.33
7.2.210.0090.00615.22
7.2.200.0000.01015.11
7.2.190.0060.00915.09
7.2.180.0060.00315.11
7.2.170.0030.00615.00
7.2.130.0070.00716.74
7.2.120.0030.01016.89
7.2.110.0000.01416.90
7.2.100.0070.00717.07
7.2.90.0060.00916.97
7.2.80.0070.00716.95
7.2.70.0110.00016.79
7.2.60.0070.00916.97
7.2.50.0060.00916.96
7.2.40.0040.01117.12
7.2.30.0050.00416.92
7.2.20.0120.00317.06
7.2.10.0090.00616.91
7.2.00.0020.00918.05
7.1.330.0030.00915.79
7.1.320.0070.00715.82
7.1.310.0060.01015.90
7.1.300.0080.00615.28
7.1.290.0060.00615.57
7.1.280.0070.00415.70
7.1.270.0030.00615.52
7.1.260.0090.00615.84
7.1.250.0080.00315.81
7.1.200.0070.00315.73
7.1.100.0100.00318.18
7.1.70.0040.00417.16
7.1.60.0040.01119.29
7.1.50.0100.01016.79
7.1.00.0000.08022.28
7.0.200.0030.00716.53
7.0.140.0070.06722.01
7.0.60.0130.07720.04
7.0.50.0030.04017.86
7.0.40.0100.08320.02
7.0.30.0200.04020.30
7.0.20.0270.07720.12
7.0.10.0270.08020.16
7.0.00.0030.04020.22
5.6.280.0030.07321.11
5.6.210.0130.07320.56
5.6.200.0200.05318.16
5.6.190.0070.05320.47
5.6.180.0000.06320.65
5.6.170.0300.05020.71
5.6.160.0130.04020.45
5.6.150.0070.08318.21
5.6.140.0070.05018.29
5.6.130.0070.03718.21
5.6.120.0070.07021.02
5.6.110.0070.05021.15
5.6.100.0070.08721.01
5.6.90.0100.08021.00
5.6.80.0030.04720.55
5.6.70.4500.03720.45
5.5.350.0070.07320.31
5.5.340.0100.07717.99
5.5.330.0070.08320.44
5.5.320.0100.06720.33
5.5.310.0370.06720.28
5.5.300.0100.07317.95
5.5.290.0030.06317.99
5.5.280.0100.08320.70
5.5.270.0100.07020.80
5.5.260.0130.07020.77
5.5.250.0200.07020.59
5.5.240.0070.05320.25
5.4.450.0830.03319.64
5.4.440.0570.05019.58
5.4.430.0930.04719.19
5.4.420.0670.06019.60
5.4.410.0930.07319.20
5.4.400.1170.05319.12
5.4.390.0930.06719.25
5.4.380.0200.04718.71
5.4.370.0130.07318.59
5.4.360.0100.05718.73
5.4.350.0300.05318.75
5.4.340.0130.05318.78
5.4.320.0080.05412.51
5.4.310.0020.04212.51
5.4.300.0060.04112.52
5.4.290.0130.03912.50
5.4.280.0090.04012.40
5.4.270.0050.03712.38
5.4.260.0040.03812.37
5.4.250.0050.03812.38
5.4.240.0040.04612.37
5.4.230.0030.04512.36
5.4.220.0040.03712.37
5.4.210.0060.03412.36
5.4.200.0050.03712.36
5.4.190.0040.03712.36
5.4.180.0090.03812.36
5.4.170.0050.04212.37
5.4.160.0040.03712.37
5.4.150.0060.03412.36
5.4.140.0050.04012.05
5.4.130.0020.03912.04
5.4.120.0050.03712.00
5.4.110.0050.03411.99
5.4.100.0060.03411.99
5.4.90.0050.03611.98
5.4.80.0050.03711.99
5.4.70.0050.03611.98
5.4.60.0080.03411.98
5.4.50.0080.03211.98
5.4.40.0050.03611.97
5.4.30.0060.03411.96
5.4.20.0060.03511.96
5.4.10.0050.03511.97
5.4.00.0030.03811.46
5.3.290.0070.04612.80
5.3.280.0070.03512.71
5.3.270.0060.03812.72
5.3.260.0050.03912.72
5.3.250.0040.04412.72
5.3.240.0030.03912.72
5.3.230.0020.04212.71
5.3.220.0040.03812.68
5.3.210.0050.04012.68
5.3.200.0050.03712.68
5.3.190.0060.04312.67
5.3.180.0070.03412.67
5.3.170.0080.03412.67
5.3.160.0030.03912.68
5.3.150.0070.04112.67
5.3.140.0040.04112.66
5.3.130.0050.04412.66
5.3.120.0050.04112.66
5.3.110.0060.03912.66
5.3.100.0040.04712.12
5.3.90.0070.03512.08
5.3.80.0040.03712.07
5.3.70.0020.03912.08
5.3.60.0060.03612.06
5.3.50.0040.03812.00
5.3.40.0020.04012.00
5.3.30.0060.03411.95
5.3.20.0030.03711.73
5.3.10.0030.03711.70
5.3.00.0050.03711.69
5.2.170.0020.0329.17
5.2.160.0050.0299.18
5.2.150.0020.0339.17
5.2.140.0090.0259.17
5.2.130.0020.0329.13
5.2.120.0060.0349.13
5.2.110.0090.0399.14
5.2.100.0050.0329.14
5.2.90.0020.0319.13
5.2.80.0050.0309.13
5.2.70.0050.0309.13
5.2.60.0050.0309.08
5.2.50.0050.0309.05
5.2.40.0070.0279.02
5.2.30.0030.0319.00
5.2.20.0040.0319.00
5.2.10.0070.0318.91
5.2.00.0060.0388.76
5.1.60.0040.0288.04
5.1.50.0050.0288.04
5.1.40.0030.0298.04
5.1.30.0020.0288.38
5.1.20.0050.0268.40
5.1.10.0030.0268.13
5.1.00.0040.0258.12
5.0.50.0020.0236.60
5.0.40.0040.0186.46
5.0.30.0050.0386.28
5.0.20.0050.0186.25
5.0.10.0040.0196.22
5.0.00.0030.0336.21
4.4.90.0040.0194.78
4.4.80.0040.0144.75
4.4.70.0040.0154.76
4.4.60.0040.0134.75
4.4.50.0020.0154.77
4.4.40.0020.0264.70
4.4.30.0030.0174.76
4.4.20.0030.0154.84
4.4.10.0020.0164.85
4.4.00.0010.0274.76
4.3.110.0010.0174.67
4.3.100.0030.0154.67
4.3.90.0030.0184.63
4.3.80.0040.0284.58
4.3.70.0030.0154.63
4.3.60.0010.0224.63
4.3.50.0030.0154.63
4.3.40.0040.0244.54
4.3.30.0010.0213.28
4.3.20.0030.0143.26
4.3.10.0020.0223.23
4.3.00.0070.01313.14

preferences:
45.1 ms | 401 KiB | 5 Q