3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { private $myCodeCapsule; public function store($context) { $this->myCodeCapsule = $context; } public function execute() { $this->myCodeCapsule->__invoke(); } } $obj = new C; $x = null; $obj->store(function () use (&$x) { $x = 1; }); $x=0; $obj->execute(); var_dump($x);

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.0200.00316.75
8.3.50.0040.01118.03
8.3.40.0040.01118.80
8.3.30.0030.01019.27
8.3.20.0070.00020.34
8.3.10.0040.00421.82
8.3.00.0040.00419.01
8.2.180.0120.00316.38
8.2.170.0140.00322.96
8.2.160.0030.01020.35
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00019.23
8.2.110.0060.00320.36
8.2.100.0080.00419.63
8.2.90.0030.00519.08
8.2.80.0030.00517.97
8.2.70.0000.00817.63
8.2.60.0070.00317.93
8.2.50.0030.00618.07
8.2.40.0030.00518.09
8.2.30.0060.00318.12
8.2.20.0080.00017.57
8.2.10.0070.00018.14
8.2.00.0000.00717.70
8.1.280.0140.00025.92
8.1.270.0060.00318.88
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.09
8.1.230.0090.00317.42
8.1.220.0090.00017.78
8.1.210.0000.00918.77
8.1.200.0030.00617.35
8.1.190.0000.00917.35
8.1.180.0040.00418.10
8.1.170.0030.00520.37
8.1.160.0070.00021.91
8.1.150.0040.00418.97
8.1.140.0040.00417.48
8.1.130.0030.00317.80
8.1.120.0040.00417.54
8.1.110.0030.00617.36
8.1.100.0070.00017.34
8.1.90.0000.00717.49
8.1.80.0030.00517.46
8.1.70.0030.00317.38
8.1.60.0050.00317.61
8.1.50.0040.00417.54
8.1.40.0000.00817.46
8.1.30.0040.00417.58
8.1.20.0030.00617.62
8.1.10.0080.00017.58
8.1.00.0000.00917.42
8.0.300.0050.00218.77
8.0.290.0060.00316.63
8.0.280.0070.00018.47
8.0.270.0000.00717.27
8.0.260.0000.00617.15
8.0.250.0030.00316.85
8.0.240.0040.00417.00
8.0.230.0030.00317.01
8.0.220.0030.00316.90
8.0.210.0050.00316.96
8.0.200.0030.00316.98
8.0.190.0040.00416.95
8.0.180.0000.00716.84
8.0.170.0070.00016.89
8.0.160.0000.00716.85
8.0.150.0040.00416.81
8.0.140.0050.00316.75
8.0.130.0050.00313.39
8.0.120.0000.00816.86
8.0.110.0030.00516.85
8.0.100.0040.00416.85
8.0.90.0000.00716.89
8.0.80.0070.01416.87
8.0.70.0040.00416.81
8.0.60.0000.00716.69
8.0.50.0000.00816.85
8.0.30.0100.01517.29
8.0.20.0100.00917.40
8.0.10.0000.00717.02
8.0.00.0080.01016.72
7.4.330.0000.00515.20
7.4.320.0070.00016.67
7.4.300.0000.00616.66
7.4.290.0070.00016.44
7.4.280.0030.00516.61
7.4.270.0000.00816.54
7.4.260.0000.00716.55
7.4.250.0040.00416.61
7.4.240.0050.00316.63
7.4.230.0030.00316.46
7.4.220.0060.01216.46
7.4.210.0000.01516.66
7.4.200.0030.00316.72
7.4.160.0030.01216.56
7.4.150.0100.00717.40
7.4.140.0110.00917.86
7.4.130.0090.00816.57
7.4.120.0050.01216.47
7.4.110.0150.00316.63
7.4.100.0060.01416.43
7.4.90.0100.01016.55
7.4.80.0060.01219.39
7.4.70.0100.00616.38
7.4.60.0100.00616.57
7.4.50.0000.00816.37
7.4.40.0070.01016.45
7.4.30.0160.00816.49
7.4.00.0050.01214.79
7.3.330.0050.00013.17
7.3.320.0140.00013.31
7.3.310.0000.00616.20
7.3.300.0030.00316.22
7.3.290.0080.01016.30
7.3.280.0080.00716.27
7.3.270.0080.00817.40
7.3.260.0070.01016.57
7.3.250.0070.01216.32
7.3.240.0100.00716.52
7.3.230.0150.00916.54
7.3.210.0030.01316.27
7.3.200.0090.00916.42
7.3.190.0080.01116.45
7.3.180.0090.00616.40
7.3.170.0090.01016.58
7.3.160.0110.01116.53
7.3.120.0070.01015.08
7.3.110.0040.01414.91
7.3.100.0060.00914.63
7.3.90.0090.00614.78
7.3.80.0000.01215.13
7.3.70.0060.00314.84
7.3.60.0030.01014.83
7.3.50.0040.01114.48
7.3.40.0040.01414.59
7.3.30.0030.00614.64
7.3.20.0060.00916.74
7.3.10.0070.00716.50
7.3.00.0060.00916.79
7.2.330.0120.00916.77
7.2.320.0130.00316.50
7.2.310.0160.00316.49
7.2.300.0080.01516.65
7.2.290.0150.00916.62
7.2.250.0130.00714.96
7.2.240.0070.01414.96
7.2.230.0070.01315.13
7.2.220.0040.01515.22
7.2.210.0040.01115.13
7.2.200.0040.01415.22
7.2.190.0000.01515.07
7.2.180.0000.01515.13
7.2.170.0130.00614.84
7.2.60.0120.00416.77
7.2.00.0040.01219.21
7.1.330.0030.00915.95
7.1.320.0060.00615.99
7.1.310.0060.00915.73
7.1.300.0000.01115.85
7.1.290.0030.00815.84
7.1.280.0060.00915.76
7.1.270.0090.00315.91
7.1.260.0030.01015.98
7.1.200.0000.01315.80
7.1.100.0060.00618.07
7.1.70.0000.01016.93
7.1.60.0090.01519.50
7.1.50.0090.01617.14
7.1.00.0100.07022.36
7.0.200.0260.01014.44
7.0.140.0070.07321.98
7.0.60.0070.07319.95
7.0.50.0070.05017.83
7.0.40.0100.04020.25
7.0.30.0270.06020.15
7.0.20.0230.08720.15
7.0.10.0300.07720.21
7.0.00.0100.08020.24
5.6.280.0100.06320.90
5.6.210.0070.04020.55
5.6.200.0100.06318.16
5.6.190.0100.08720.57
5.6.180.0270.05720.39
5.6.170.0370.06020.50
5.6.160.0070.04020.48
5.6.150.0100.03318.25
5.6.140.0100.05718.16
5.6.130.0000.04718.32
5.6.120.0000.05720.90
5.6.110.0100.07021.12
5.6.100.0030.09021.02
5.6.90.0030.04020.99
5.6.80.0100.06020.40
5.6.70.0100.03720.42
5.5.350.0200.03320.38
5.5.340.0030.08317.95
5.5.330.0100.07320.36
5.5.320.0000.05020.43
5.5.310.0300.03720.34
5.5.300.0130.07018.04
5.5.290.0030.04317.95
5.5.280.0070.07720.80
5.5.270.0070.04320.77
5.5.260.0070.04320.97
5.5.250.0170.07320.47
5.5.240.0030.04720.37
5.4.450.0200.06019.46
5.4.440.0770.07019.55
5.4.430.0100.06019.43
5.4.420.0670.07319.43
5.4.410.0070.05719.03
5.4.400.0430.05018.67
5.4.390.0370.04718.63
5.4.380.0300.06018.63
5.4.370.0270.05718.76
5.4.360.0330.05018.84
5.4.350.0170.06718.48
5.4.340.0470.06718.61
5.4.320.0400.07318.59
5.4.310.0470.07018.61
5.4.300.0400.06718.74
5.4.290.0330.06018.61
5.4.280.0330.06318.54
5.4.270.0530.06018.76
5.4.260.0430.05718.77
5.4.250.0470.06718.78
5.4.240.0500.05318.84
5.4.230.0430.06718.81
5.4.220.0330.06018.52
5.4.210.0330.06718.75
5.4.200.0370.04716.54
5.4.190.0400.07718.52
5.4.180.0370.07318.79
5.4.170.0170.07718.77
5.4.160.0130.07718.51
5.4.150.0530.05318.81
5.4.140.0470.06016.34
5.4.130.0300.07016.20
5.4.120.0300.06016.29
5.4.110.0430.05716.23
5.4.100.0630.07016.25
5.4.90.0470.07316.33
5.4.80.0400.07316.42
5.4.70.0300.07716.42
5.4.60.0370.07316.31
5.4.50.0400.05316.24
5.4.40.0470.07716.25
5.4.30.0330.07316.26
5.4.20.0370.06716.14
5.4.10.0530.06016.26
5.4.00.0400.06715.64
5.3.290.0530.07314.69
5.3.280.0700.04714.74
5.3.270.0370.07714.81
5.3.260.0570.06014.65
5.3.250.0500.06314.83
5.3.240.0370.07314.71
5.3.230.0630.06714.60
5.3.220.0600.05314.63
5.3.210.0370.07714.59
5.3.200.0500.06714.59
5.3.190.0470.06714.60
5.3.180.0500.06014.70
5.3.170.0500.06314.75
5.3.160.0430.06714.59
5.3.150.0500.07014.79
5.3.140.0570.05714.59
5.3.130.0430.07314.68
5.3.120.0430.07714.75
5.3.110.0600.07314.73
5.3.100.0400.06314.10
5.3.90.0400.06714.15
5.3.80.0330.07014.14
5.3.70.0430.05714.04
5.3.60.0400.06714.07
5.3.50.0330.05713.95
5.3.40.0400.06314.03
5.3.30.0370.05013.97
5.3.20.0470.06013.73
5.3.10.0530.05313.71
5.3.00.0330.05313.64
5.2.170.0370.05011.16
5.2.160.0330.04711.14
5.2.150.0500.05311.28
5.2.140.0430.04711.25
5.2.130.0330.06311.16
5.2.120.0330.05011.32
5.2.110.0330.05311.16
5.2.100.0500.02711.15
5.2.90.0200.04711.15
5.2.80.0200.06011.15
5.2.70.0270.05711.13
5.2.60.0230.05711.27
5.2.50.0330.04711.04
5.2.40.0100.05711.02
5.2.30.0300.03710.98
5.2.20.0130.04711.09
5.2.10.0230.04311.09
5.2.00.0330.04010.77
5.1.60.0230.04010.06
5.1.50.0270.04710.02
5.1.40.0370.03710.10
5.1.30.0200.05310.44
5.1.20.0200.05310.42
5.1.10.0170.03710.15
5.1.00.0300.03310.11
5.0.50.0170.0338.69
5.0.40.0170.0338.50
5.0.30.0100.0608.36
5.0.20.0100.0408.27
5.0.10.0170.0208.38
5.0.00.0170.0338.35
4.4.90.0130.0275.90
4.4.80.0170.0305.90
4.4.70.0130.0305.98
4.4.60.0070.0335.93
4.4.50.0170.0275.90
4.4.40.0130.0475.89
4.4.30.0230.0235.92
4.4.20.0070.0235.97
4.4.10.0130.0275.98
4.4.00.0130.0305.91
4.3.110.0200.0205.81
4.3.100.0030.0305.79
4.3.90.0070.0235.79
4.3.80.0070.0375.79
4.3.70.0070.0235.76
4.3.60.0100.0235.82
4.3.50.0170.0275.89
4.3.40.0130.0335.78
4.3.30.0170.0274.58
4.3.20.0070.0274.52
4.3.10.0070.0274.57
4.3.00.0100.0206.51

preferences:
48.11 ms | 400 KiB | 5 Q