3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Mutable { private $x; public function __construct(int $x) { $this->x = $x; } public function setX(int $x): void { $this->x = $x; } public function x(): int { return $this->x; } } final class User { private $m; public function __construct(Mutable $m) { $this->m = $m; } public function x(): void { echo "{$this->m->x()}\n"; } } $m = new Mutable(42); $u = new User($m); $u->x(); $m->setX(-1); $u->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.0190.00016.75
8.3.50.0120.00616.63
8.3.40.0140.00718.84
8.3.30.0080.00818.62
8.3.20.0080.00020.16
8.3.10.0040.00423.65
8.3.00.0040.00421.99
8.2.180.0150.00316.63
8.2.170.0140.00022.96
8.2.160.0140.00719.16
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0040.00419.27
8.2.120.0000.00826.35
8.2.110.0100.00020.34
8.2.100.0080.00417.91
8.2.90.0000.00819.05
8.2.80.0050.00318.04
8.2.70.0040.00417.63
8.2.60.0000.00818.16
8.2.50.0080.00018.10
8.2.40.0030.00620.68
8.2.30.0050.00319.13
8.2.20.0050.00218.06
8.2.10.0000.00718.07
8.2.00.0070.00018.05
8.1.280.0100.00725.92
8.1.270.0040.00423.96
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0100.00022.27
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0000.00817.22
8.1.180.0060.00318.10
8.1.170.0000.00920.64
8.1.160.0030.00318.86
8.1.150.0040.00420.64
8.1.140.0040.00419.43
8.1.130.0060.00318.83
8.1.120.0030.00517.42
8.1.110.0030.00617.32
8.1.100.0050.00317.42
8.1.90.0000.00717.33
8.1.80.0040.00417.41
8.1.70.0030.00317.32
8.1.60.0000.00817.57
8.1.50.0040.00417.56
8.1.40.0040.00417.56
8.1.30.0040.00417.50
8.1.20.0040.00417.72
8.1.10.0050.00517.57
8.1.00.0050.00317.48
8.0.300.0040.00418.77
8.0.290.0030.00516.75
8.0.280.0040.00418.34
8.0.270.0030.00417.18
8.0.260.0050.00216.82
8.0.250.0030.00316.96
8.0.240.0000.00817.04
8.0.230.0000.00916.93
8.0.220.0000.00716.83
8.0.210.0030.00316.85
8.0.200.0070.00016.99
8.0.190.0040.00416.99
8.0.180.0040.00417.02
8.0.170.0030.00516.91
8.0.160.0000.00716.93
8.0.150.0040.00416.74
8.0.140.0040.00416.93
8.0.130.0030.00313.32
8.0.120.0040.00416.82
8.0.110.0040.00417.00
8.0.100.0000.00716.99
8.0.90.0000.00716.83
8.0.80.0130.00916.99
8.0.70.0040.00416.89
8.0.60.0000.00916.90
8.0.50.0040.00416.87
8.0.30.0070.01017.05
8.0.20.0120.00717.40
8.0.10.0000.00716.95
8.0.00.0130.01016.66
7.4.330.0000.00515.55
7.4.320.0030.00316.42
7.4.300.0030.00316.55
7.4.290.0000.00816.52
7.4.280.0040.00416.63
7.4.270.0000.00616.63
7.4.260.0000.00716.50
7.4.250.0060.00316.38
7.4.240.0030.00316.53
7.4.230.0000.00716.71
7.4.220.0090.00916.54
7.4.210.0060.00916.52
7.4.200.0070.00016.40
7.4.160.0080.01016.40
7.4.150.0210.00317.40
7.4.140.0130.00817.86
7.4.130.0090.01616.48
7.4.120.0070.01216.53
7.4.110.0030.01316.48
7.4.100.0130.00316.44
7.4.90.0080.00816.31
7.4.80.0070.01019.39
7.4.70.0040.01116.58
7.4.60.0090.00616.50
7.4.50.0150.00416.18
7.4.40.0120.00416.43
7.4.30.0070.01116.48
7.4.10.0100.00716.41
7.4.00.0160.00215.51
7.3.330.0040.00413.32
7.3.320.0030.00313.29
7.3.310.0000.00716.12
7.3.300.0000.00716.13
7.3.290.0080.00616.32
7.3.280.0080.00816.28
7.3.270.0120.00617.40
7.3.260.0070.00916.59
7.3.250.0140.00716.30
7.3.240.0130.00716.36
7.3.230.0120.00616.35
7.3.210.0090.00916.48
7.3.200.0060.01116.38
7.3.190.0130.00316.30
7.3.180.0060.00916.38
7.3.170.0100.00616.50
7.3.160.0030.01316.22
7.3.130.0150.00316.39
7.3.120.0090.00915.65
7.3.110.0020.01115.47
7.3.100.0060.01215.40
7.3.90.0090.00615.51
7.3.80.0070.00615.47
7.3.70.0060.00715.52
7.3.60.0060.00715.45
7.3.50.0060.00815.50
7.3.40.0040.01115.58
7.3.30.0080.00515.58
7.3.20.0100.00317.27
7.3.10.0080.00517.36
7.3.00.0020.01417.19
7.2.330.0110.00716.82
7.2.320.0090.00816.77
7.2.310.0140.00316.85
7.2.300.0030.01316.36
7.2.290.0190.00516.47
7.2.260.0100.01016.52
7.2.250.0030.01715.79
7.2.240.0080.00715.68
7.2.230.0060.00915.87
7.2.220.0050.01115.93
7.2.210.0050.01215.87
7.2.200.0020.01215.83
7.2.190.0070.00915.80
7.2.180.0030.00915.70
7.2.170.0020.01515.67
7.2.160.0100.00616.36
7.2.150.0090.00318.52
7.2.140.0030.00918.37
7.2.130.0040.01418.46
7.2.120.0080.00318.38
7.2.110.0060.00318.41
7.2.100.0110.00718.60
7.2.90.0060.00918.70
7.2.80.0080.00818.28
7.2.70.0000.01418.56
7.2.60.0060.01017.69
7.2.50.0000.01218.27
7.2.40.0050.00818.21
7.2.30.0050.00518.52
7.2.20.0090.00618.37
7.2.10.0090.00618.50
7.2.00.0040.00918.84
7.1.330.0050.01016.66
7.1.320.0070.00516.50
7.1.310.0080.00716.45
7.1.300.0090.00116.62
7.1.290.0060.00716.60
7.1.280.0060.01016.56
7.1.270.0040.01016.63
7.1.260.0090.00616.44
7.1.250.0110.00317.50
7.1.240.0080.00017.31
7.1.230.0090.00317.31
7.1.220.0030.01417.10
7.1.210.0100.00317.30
7.1.200.0030.01016.62
7.1.190.0000.01217.30
7.1.180.0000.00917.20
7.1.170.0060.00917.37
7.1.160.0030.01417.30
7.1.150.0100.00717.35
7.1.140.0070.01017.30
7.1.130.0060.00317.18
7.1.120.0030.01017.22
7.1.110.0030.01017.44
7.1.100.0050.00917.79
7.1.90.0060.00317.38
7.1.80.0070.01017.43
7.1.70.0040.01417.13
7.1.60.0210.00825.93
7.1.50.0240.00626.05
7.1.40.0140.01425.86
7.1.30.0130.01825.89
7.1.20.0200.00825.84
7.1.10.0030.01417.04
7.1.00.0050.01216.96
7.0.330.0030.01217.13
7.0.320.0030.01217.11
7.0.310.0050.00517.02
7.0.300.0030.00617.04
7.0.290.0000.01717.20
7.0.280.0060.00617.08
7.0.270.0060.00616.86
7.0.260.0100.00316.89
7.0.250.0000.01317.20
7.0.240.0050.00517.05
7.0.230.0080.00817.05
7.0.220.0060.00917.13
7.0.210.0030.01017.11
7.0.200.0050.00816.89
7.0.190.0070.00916.90
7.0.180.0070.00916.57
7.0.170.0050.01116.76
7.0.160.0080.00916.67
7.0.150.0020.01516.67
7.0.140.0140.00516.65
7.0.130.0120.00616.83
7.0.120.0040.01316.83
7.0.110.0080.00616.57
7.0.100.0060.01016.84
7.0.90.0060.01116.56
7.0.80.0010.01316.45
7.0.70.0050.01216.56
7.0.60.0070.00916.57
7.0.50.0100.00916.69
7.0.40.0070.01115.67
7.0.30.0050.01015.67
7.0.20.0040.01215.72
7.0.10.0070.00815.74
7.0.00.0080.00815.64
5.6.400.0040.00815.74
5.6.390.0030.01315.90
5.6.380.0060.00915.53
5.6.370.0030.00715.61
5.6.360.0040.01115.50
5.6.350.0030.01015.57
5.6.340.0030.01015.40
5.6.330.0060.00315.71
5.6.320.0030.01415.29
5.6.310.0120.00315.41
5.6.300.0090.00615.91
5.6.290.0030.01015.73
5.6.280.0060.01215.77
5.6.270.0030.01215.44
5.6.260.0090.00615.61
5.6.250.0050.00815.39
5.6.240.0030.01315.63
5.6.230.0070.00715.71
5.6.220.0000.01315.49
5.6.210.0030.01415.75
5.6.200.0100.00615.52
5.6.190.0060.01215.95
5.6.180.0030.00715.76
5.6.170.0000.01015.90
5.6.160.0070.00715.86
5.6.150.0090.00315.57
5.6.140.0110.00015.61
5.6.130.0000.01615.60
5.6.120.0030.01015.56
5.6.110.0120.00015.50
5.6.100.0100.00315.50
5.6.90.0060.00615.47
5.6.80.0070.00715.38
5.6.70.0060.00615.62
5.6.60.0090.00315.51
5.6.50.0000.00915.52
5.6.40.0040.01115.67
5.6.30.0120.00315.50
5.6.20.0060.00615.52
5.6.10.0110.00315.66
5.6.00.0060.00815.57

preferences:
44.62 ms | 400 KiB | 5 Q