3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $x; public function __construct($v) { $this->x = $v; } public function get() { return function() { return $this->increment(); }; } public function increment() { $this->x++; } public function getX() { return $this->x; } } $a = new A(1); $b = $a->get(); var_dump($b()); var_dump($a->getX());

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.0110.00418.43
8.3.50.0070.00921.25
8.3.40.0090.00618.59
8.3.30.0140.00019.13
8.3.20.0070.00020.30
8.3.10.0000.00823.48
8.3.00.0050.00319.25
8.2.180.0110.00416.38
8.2.170.0090.01222.96
8.2.160.0070.00720.35
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00422.25
8.2.110.0030.00620.54
8.2.100.0090.00418.16
8.2.90.0000.00819.17
8.2.80.0000.00917.97
8.2.70.0090.00017.50
8.2.60.0030.00617.93
8.2.50.0050.00318.07
8.2.40.0000.00820.07
8.2.30.0030.00518.15
8.2.20.0000.00717.73
8.2.10.0000.00818.13
8.2.00.0040.00417.86
8.1.280.0070.00725.92
8.1.270.0000.00922.05
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.87
8.1.230.0040.00718.96
8.1.220.0000.00817.78
8.1.210.0030.00618.77
8.1.200.0060.00317.23
8.1.190.0040.00417.25
8.1.180.0080.00018.10
8.1.170.0050.00318.64
8.1.160.0030.00522.04
8.1.150.0060.00318.89
8.1.140.0000.00817.53
8.1.130.0070.00017.85
8.1.120.0000.00817.52
8.1.110.0020.00517.52
8.1.100.0040.00417.46
8.1.90.0000.00717.32
8.1.80.0040.00417.38
8.1.70.0000.00817.42
8.1.60.0030.00517.65
8.1.50.0040.00417.42
8.1.40.0000.00917.57
8.1.30.0060.00317.68
8.1.20.0050.00317.71
8.1.10.0000.00817.41
8.1.00.0000.00717.46
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0070.00018.32
8.0.270.0030.00317.22
8.0.260.0000.00617.24
8.0.250.0030.00316.98
8.0.240.0040.00416.84
8.0.230.0050.00216.90
8.0.220.0060.00316.80
8.0.210.0070.00016.71
8.0.200.0030.00316.99
8.0.190.0040.00417.02
8.0.180.0040.00416.83
8.0.170.0000.00816.92
8.0.160.0000.00717.01
8.0.150.0000.00716.88
8.0.140.0000.00816.87
8.0.130.0000.00613.33
8.0.120.0000.00716.88
8.0.110.0060.00316.73
8.0.100.0000.00816.74
8.0.90.0000.00716.96
8.0.80.0100.00616.95
8.0.70.0030.00516.97
8.0.60.0040.00416.97
8.0.50.0000.00716.87
8.0.30.0090.01117.06
8.0.20.0100.00817.40
8.0.10.0000.00816.93
8.0.00.0140.00416.63
7.4.330.0000.00515.00
7.4.320.0030.00316.50
7.4.300.0000.00716.60
7.4.290.0030.00316.66
7.4.280.0040.00416.61
7.4.270.0080.00016.64
7.4.260.0000.00716.45
7.4.250.0040.00416.48
7.4.240.0020.00516.59
7.4.230.0070.00016.72
7.4.220.0100.01616.69
7.4.210.0130.00716.46
7.4.200.0070.00016.43
7.4.160.0080.00816.70
7.4.150.0030.01617.40
7.4.140.0090.01317.86
7.4.130.0110.00816.48
7.4.120.0100.00716.44
7.4.110.0100.00716.66
7.4.100.0090.01216.71
7.4.90.0160.00616.53
7.4.80.0120.00619.39
7.4.70.0100.00616.56
7.4.60.0110.00616.45
7.4.50.0000.00916.55
7.4.40.0130.00316.47
7.4.30.0120.01116.32
7.4.00.0090.00614.84
7.3.330.0000.00513.12
7.3.320.0030.00313.31
7.3.310.0000.00716.26
7.3.300.0030.00316.36
7.3.290.0070.00716.27
7.3.280.0070.00816.30
7.3.270.0090.00917.40
7.3.260.0120.00416.34
7.3.250.0130.00316.29
7.3.240.0070.01116.56
7.3.230.0060.01216.39
7.3.210.0100.00716.30
7.3.200.0110.00719.39
7.3.190.0140.00316.44
7.3.180.0120.00316.27
7.3.170.0000.01616.46
7.3.160.0100.00716.30
7.3.10.0060.00916.62
7.3.00.0070.01116.37
7.2.330.0070.01016.78
7.2.320.0080.00816.45
7.2.310.0030.01316.45
7.2.300.0110.00516.49
7.2.290.0100.01316.32
7.2.130.0130.00716.51
7.2.120.0090.00916.25
7.2.110.0120.00816.61
7.2.100.0080.01216.50
7.2.90.0180.00416.63
7.2.80.0170.01116.80
7.2.70.0210.00016.57
7.2.60.0060.01216.79
7.2.50.0120.01516.43
7.2.40.0150.00416.69
7.2.30.0100.01016.45
7.2.20.0130.00616.81
7.2.10.0030.01016.53
7.2.00.0110.01117.01
7.1.250.0090.00915.19
7.1.200.0070.00715.74
7.1.70.0030.00817.17
7.1.60.0140.01019.11
7.1.50.0240.01034.60
7.1.00.0070.07722.40
7.0.200.8630.00016.69
7.0.140.0030.07322.01
7.0.60.0070.06719.93
7.0.50.0100.03317.79
7.0.40.0070.08320.24
7.0.30.0270.07720.07
7.0.20.0170.04320.26
7.0.10.0270.04020.25
7.0.00.0130.07320.21
5.6.210.0030.04720.62
5.6.200.0030.04018.19
5.6.190.0100.08320.63
5.6.180.0000.06320.57
5.6.170.0170.04020.55
5.6.160.0130.05020.50
5.6.150.0030.08318.15
5.6.140.0100.07018.28
5.6.130.0030.07018.21
5.6.120.0100.06021.00
5.6.110.0030.06720.98
5.6.100.0030.07321.14
5.6.90.0030.04021.14
5.6.80.0030.04020.48
5.6.70.4500.03720.54
5.5.350.0030.05020.34
5.5.340.0130.06718.04
5.5.330.0100.04720.30
5.5.320.0230.06720.27
5.5.310.0330.08020.37
5.5.300.0100.07018.02
5.5.290.0070.07317.95
5.5.280.0000.09020.78
5.5.270.0030.04320.65
5.5.260.0070.08020.74
5.5.250.0100.07720.70
5.5.240.0030.07720.17
5.4.450.0770.06019.55
5.4.440.0830.05719.45
5.4.430.0870.05719.30
5.4.420.0700.00019.54
5.4.410.0630.00019.32
5.4.400.0600.00019.25
5.4.390.0600.00019.08
5.4.380.0630.00019.11
5.4.370.0830.00019.21
5.4.360.0670.00019.07
5.4.350.0630.00019.25
5.4.340.0050.03612.03
5.4.320.0080.04212.51
5.4.310.0050.04012.51
5.4.300.0060.03712.51
5.4.290.0080.03912.50
5.4.280.0090.03212.40
5.4.270.0060.03812.40
5.4.260.0090.03612.40
5.4.250.0060.03712.41
5.4.240.0080.04312.40
5.4.230.0050.04312.39
5.4.220.0090.03312.39
5.4.210.0060.03712.39
5.4.200.0070.03812.39
5.4.190.0070.03312.39
5.4.180.0090.03612.39
5.4.170.0090.03212.41
5.4.160.0080.04612.40
5.4.150.0080.03912.40
5.4.140.0080.03512.08
5.4.130.0090.04512.07
5.4.120.0080.03312.02
5.4.110.0030.03812.02
5.4.100.0080.03312.02
5.4.90.0060.03612.02
5.4.80.0070.03512.02
5.4.70.0040.03712.02
5.4.60.0110.03612.02
5.4.50.0080.03812.02
5.4.40.0070.03312.00
5.4.30.0090.03212.00
5.4.20.0070.03312.00
5.4.10.0120.03312.00
5.4.00.0060.03611.49
5.3.290.0090.03612.80
5.3.280.0040.04012.71
5.3.270.0060.03912.72
5.3.260.0040.04012.72
5.3.250.0070.03512.72
5.3.240.0060.03612.72
5.3.230.0060.03812.70
5.3.220.0110.03812.68
5.3.210.0050.04312.68
5.3.200.0080.03612.68
5.3.190.0070.03712.68
5.3.180.0030.03912.67
5.3.170.0040.03912.67
5.3.160.0060.03712.67
5.3.150.0050.03812.67
5.3.140.0070.03612.66
5.3.130.0020.04212.66
5.3.120.0050.04012.66
5.3.110.0080.03712.65
5.3.100.0050.04712.13
5.3.90.0040.03712.11
5.3.80.0070.03512.11
5.3.70.0060.03712.10
5.3.60.0050.03712.09
5.3.50.0060.03612.04
5.3.40.0040.03812.04
5.3.30.0040.03712.00
5.3.20.0030.03711.78
5.3.10.0080.03411.74
5.3.00.0050.04011.72
5.2.170.0080.0359.22
5.2.160.0060.0279.23
5.2.150.0090.0299.22
5.2.140.0020.0379.22
5.2.130.0040.0359.18
5.2.120.0040.0289.18
5.2.110.0060.0279.20
5.2.100.0030.0309.19
5.2.90.0100.0289.18
5.2.80.0070.0319.18
5.2.70.0070.0339.18
5.2.60.0060.0289.13
5.2.50.0050.0359.09
5.2.40.0070.0279.08
5.2.30.0080.0309.05
5.2.20.0110.0239.04
5.2.10.0120.0228.95
5.2.00.0050.0298.82
5.1.60.0030.0258.09
5.1.50.0080.0288.09
5.1.40.0040.0258.07
5.1.30.0060.0248.42
5.1.20.0040.0278.45
5.1.10.0040.0288.16
5.1.00.0020.0288.17
5.0.50.0060.0186.65
5.0.40.0040.0196.50
5.0.30.0060.0296.32
5.0.20.0030.0216.28
5.0.10.0060.0186.26
5.0.00.0060.0346.25
4.4.90.0010.0184.78
4.4.80.0060.0144.76
4.4.70.0050.0134.75
4.4.60.0050.0164.75
4.4.50.0010.0204.77
4.4.40.0100.0234.71
4.4.30.0040.0164.76
4.4.20.0050.0154.84
4.4.10.0040.0154.85
4.4.00.0110.0224.76
4.3.110.0060.0164.67
4.3.100.0040.0164.67
4.3.90.0030.0174.63
4.3.80.0040.0244.58
4.3.70.0030.0174.63
4.3.60.0040.0144.63
4.3.50.0060.0144.63
4.3.40.0040.0244.54
4.3.30.0040.0203.30
4.3.20.0060.0203.28
4.3.10.0040.0153.23
4.3.00.0200.0207.50

preferences:
43.92 ms | 401 KiB | 5 Q