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 $this->do(function() { return $this->increment(); }); } public function increment() { return $this->x++; } public function do($callback) { return $callback(); } public function getX() { return $this->x; } } $a = new A(1); $b = $a->get(); 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.70.0130.00716.38
8.3.60.0090.00618.28
8.3.50.0170.00221.05
8.3.40.0070.00718.84
8.3.30.0110.00319.17
8.3.20.0080.00020.13
8.3.10.0080.00023.71
8.3.00.0030.00519.13
8.2.180.0120.00616.38
8.2.170.0110.00722.96
8.2.160.0100.00320.44
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00322.29
8.2.110.0030.00720.27
8.2.100.0110.00018.03
8.2.90.0040.00419.11
8.2.80.0000.00917.97
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0050.00318.07
8.2.40.0040.00419.95
8.2.30.0070.00018.00
8.2.20.0040.00417.68
8.2.10.0000.00818.07
8.2.00.0070.00017.82
8.1.280.0060.00925.92
8.1.270.0100.00023.82
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.68
8.1.230.0070.00419.05
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.23
8.1.180.0030.00618.10
8.1.170.0000.00918.64
8.1.160.0070.00021.96
8.1.150.0060.00318.81
8.1.140.0000.00717.34
8.1.130.0030.00317.79
8.1.120.0030.00517.49
8.1.110.0030.00517.40
8.1.100.0070.00017.35
8.1.90.0000.00717.48
8.1.80.0040.00417.33
8.1.70.0030.00317.35
8.1.60.0040.00417.64
8.1.50.0040.00417.56
8.1.40.0030.00617.55
8.1.30.0040.00417.60
8.1.20.0080.00017.75
8.1.10.0000.00717.49
8.1.00.0000.00717.48
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0070.00018.29
8.0.270.0000.00717.19
8.0.260.0000.00817.20
8.0.250.0030.00316.86
8.0.240.0000.00816.80
8.0.230.0050.00216.85
8.0.220.0080.00016.86
8.0.210.0050.00316.81
8.0.200.0070.00016.91
8.0.190.0000.00816.97
8.0.180.0040.00416.82
8.0.170.0080.00017.00
8.0.160.0000.00716.97
8.0.150.0000.00816.85
8.0.140.0080.00016.87
8.0.130.0050.00013.36
8.0.120.0000.00716.86
8.0.110.0040.00416.82
8.0.100.0000.00816.76
8.0.90.0040.00416.74
8.0.80.0060.01016.83
8.0.70.0000.00716.80
8.0.60.0040.00416.73
8.0.50.0000.00716.79
8.0.30.0120.01016.91
8.0.20.0080.01317.40
8.0.10.0070.00017.07
8.0.00.0020.01516.61
7.4.330.0020.00215.00
7.4.320.0060.00016.61
7.4.300.0060.00016.51
7.4.290.0000.00716.52
7.4.280.0000.00716.61
7.4.270.0000.00716.57
7.4.260.0030.00316.63
7.4.250.0030.00516.54
7.4.240.0020.00516.54
7.4.230.0000.00816.70
7.4.220.0060.01216.60
7.4.210.0120.00916.70
7.4.200.0040.00416.53
7.4.160.0110.01116.48
7.4.150.0190.00617.40
7.4.140.0090.00917.86
7.4.130.0080.01316.46
7.4.120.0100.00716.57
7.4.110.0070.01016.59
7.4.100.0110.00616.56
7.4.90.0040.01716.66
7.4.80.0120.00619.39
7.4.70.0090.00616.48
7.4.60.0060.01216.68
7.4.50.0080.00016.18
7.4.40.0080.00816.35
7.4.30.0040.01216.32
7.4.00.0030.01215.02
7.3.330.0020.00213.32
7.3.320.0020.00213.30
7.3.310.0040.00416.16
7.3.300.0070.00016.15
7.3.290.0150.00016.21
7.3.280.0070.01016.26
7.3.270.0240.00017.40
7.3.260.0030.01416.18
7.3.250.0100.00816.38
7.3.240.0150.00916.39
7.3.230.0060.01216.39
7.3.210.0120.00916.29
7.3.200.0060.01119.39
7.3.190.0120.00616.57
7.3.180.0060.00916.32
7.3.170.0120.00416.29
7.3.160.0100.01016.25
7.3.10.0050.00916.63
7.3.00.0030.00916.52
7.2.330.0070.01016.75
7.2.320.0130.00316.65
7.2.310.0040.01416.80
7.2.300.0140.00316.68
7.2.290.0070.01716.41
7.2.130.0080.00616.96
7.2.120.0030.00816.88
7.2.110.0040.00916.86
7.2.100.0030.00916.84
7.2.90.0080.00616.87
7.2.80.0070.00316.81
7.2.70.0060.00716.88
7.2.60.0070.00716.75
7.2.50.0020.01016.92
7.2.40.0070.00616.71
7.2.30.0050.00616.77
7.2.20.0060.00916.84
7.2.10.0060.00516.99
7.2.00.0060.00717.61
7.1.250.0030.00715.56
7.1.200.0000.01415.76
7.1.100.0040.01117.70
7.1.70.0030.00717.05
7.1.60.0130.01019.11
7.1.50.0070.01716.81
7.1.00.0100.07022.30
7.0.200.0150.00616.48
7.0.140.0100.06722.16
7.0.60.0130.07719.97
7.0.50.0030.04017.88
7.0.40.0100.06720.13
7.0.30.0500.04320.28
7.0.20.0200.04320.15
7.0.10.0100.05320.09
7.0.00.0070.07720.06
5.6.280.0030.07021.03
5.6.210.0070.03720.76
5.6.200.0170.05018.26
5.6.190.0070.08720.49
5.6.180.0430.06320.67
5.6.170.0300.05320.53
5.6.160.0100.07720.48
5.6.150.0070.08018.19
5.6.140.0000.04018.17
5.6.130.0170.06318.18
5.6.120.0100.07721.10
5.6.110.0070.07720.99
5.6.100.0070.07021.18
5.6.90.0130.06321.11
5.6.80.0030.08020.52
5.5.350.0070.06020.50
5.5.340.0070.06318.09
5.5.330.0030.05020.57
5.5.320.0400.07320.25
5.5.310.0130.05320.23
5.5.300.0030.08717.95
5.5.290.0070.04018.00
5.5.280.0070.05320.81
5.5.270.0200.05320.64
5.5.260.0070.06020.89
5.5.250.0030.08320.80
5.5.240.0230.06720.30
5.4.450.0130.06019.56
5.4.440.0800.07719.61
5.4.430.0800.06019.60
5.4.420.0670.00019.45
5.4.410.0800.00019.42
5.4.400.0700.00019.02
5.4.390.0630.00019.11
5.4.380.0630.00019.02
5.4.370.0630.00019.11
5.4.360.0600.00019.13
5.4.350.0670.00019.07
5.4.340.0080.03912.04
5.4.320.0050.03812.53
5.4.310.0080.03612.52
5.4.300.0060.03912.53
5.4.290.0110.04912.52
5.4.280.0060.04112.42
5.4.270.0090.03412.41
5.4.260.0090.04312.42
5.4.250.0080.04012.41
5.4.240.0040.04912.42
5.4.230.0070.03812.41
5.4.220.0040.03912.41
5.4.210.0060.03512.41
5.4.200.0060.05012.41
5.4.190.0070.04012.41
5.4.180.0080.03412.41
5.4.170.0050.03812.41
5.4.160.0050.04612.41
5.4.150.0060.04312.41
5.4.140.0140.04012.09
5.4.130.0050.04412.08
5.4.120.0070.04212.04
5.4.110.0060.03612.04
5.4.100.0070.03412.04
5.4.90.0090.03712.04
5.4.80.0100.03212.04
5.4.70.0050.03512.04
5.4.60.0070.03412.04
5.4.50.0090.03312.03
5.4.40.0050.03612.02
5.4.30.0060.03512.02
5.4.20.0090.03112.02
5.4.10.0060.03312.02
5.4.00.0060.03511.51
5.3.290.0060.03812.80
5.3.280.0100.03312.71
5.3.270.0060.04312.73
5.3.260.0090.03612.72
5.3.250.0070.03712.72
5.3.240.0060.04712.72
5.3.230.0030.04012.71
5.3.220.0100.04012.68
5.3.210.0060.03812.68
5.3.200.0040.03812.68
5.3.190.0130.03012.68
5.3.180.0040.03812.67
5.3.170.0030.03912.67
5.3.160.0050.04512.67
5.3.150.0080.03412.67
5.3.140.0060.04112.66
5.3.130.0080.03512.66
5.3.120.0060.04512.65
5.3.110.0060.03712.66
5.3.100.0080.03512.14
5.3.90.0060.04612.12
5.3.80.0030.03912.10
5.3.70.0060.03612.10
5.3.60.0050.03612.09
5.3.50.0110.04312.04
5.3.40.0020.04012.03
5.3.30.0090.04311.99
5.3.20.0020.03811.78
5.3.10.0060.03311.74
5.3.00.0060.03511.73
5.2.170.0050.0309.22
5.2.160.0080.0329.22
5.2.150.0060.0299.23
5.2.140.0020.0339.22
5.2.130.0040.0399.18
5.2.120.0060.0369.18
5.2.110.0070.0319.19
5.2.100.0050.0299.19
5.2.90.0060.0279.18
5.2.80.0030.0389.18
5.2.70.0060.0349.18
5.2.60.0020.0349.13
5.2.50.0070.0279.10
5.2.40.0030.0309.08
5.2.30.0050.0369.05
5.2.20.0050.0289.05
5.2.10.0070.0258.95
5.2.00.0050.0288.82
5.1.60.0060.0228.09
5.1.50.0050.0268.09
5.1.40.0070.0218.07
5.1.30.0070.0238.42
5.1.20.0090.0228.45
5.1.10.0040.0268.17
5.1.00.0050.0258.17
5.0.50.0040.0206.65
5.0.40.0050.0176.50
5.0.30.0040.0306.32
5.0.20.0020.0206.29
5.0.10.0040.0196.26
5.0.00.0030.0316.25
4.4.90.0020.0164.78
4.4.80.0020.0184.76
4.4.70.0050.0154.75
4.4.60.0060.0164.75
4.4.50.0030.0174.77
4.4.40.0040.0234.71
4.4.30.0060.0124.76
4.4.20.0030.0154.84
4.4.10.0050.0134.85
4.4.00.0050.0224.76
4.3.110.0070.0134.66
4.3.100.0030.0184.67
4.3.90.0040.0134.63
4.3.80.0010.0294.59
4.3.70.0040.0144.63
4.3.60.0040.0134.63
4.3.50.0040.0154.63
4.3.40.0030.0234.54
4.3.30.0010.0173.30
4.3.20.0010.0173.28
4.3.10.0020.0153.23
4.3.00.0000.0237.50

preferences:
44.48 ms | 401 KiB | 5 Q