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}\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.0130.00617.00
8.3.50.0140.00316.31
8.3.40.0110.00418.77
8.3.30.0070.00718.65
8.3.20.0080.00020.09
8.3.10.0040.00423.53
8.3.00.0050.00322.04
8.2.180.0110.00716.50
8.2.170.0090.00922.96
8.2.160.0070.00719.27
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00419.30
8.2.120.0060.00326.35
8.2.110.0000.01020.57
8.2.100.0090.00318.03
8.2.90.0080.00019.22
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0030.00617.92
8.2.50.0050.00318.10
8.2.40.0040.00420.61
8.2.30.0040.00419.25
8.2.20.0070.00018.06
8.2.10.0070.00018.02
8.2.00.0050.00217.93
8.1.280.0100.00725.92
8.1.270.0040.00423.95
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.92
8.1.230.0100.00022.21
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0090.00018.91
8.1.160.0040.00418.89
8.1.150.0040.00420.64
8.1.140.0000.00719.48
8.1.130.0030.00618.83
8.1.120.0050.00317.31
8.1.110.0000.00817.36
8.1.100.0040.00417.30
8.1.90.0050.00217.31
8.1.80.0070.00017.43
8.1.70.0030.00317.40
8.1.60.0080.00017.65
8.1.50.0000.00917.40
8.1.40.0040.00417.45
8.1.30.0040.00417.63
8.1.20.0040.00417.61
8.1.10.0030.00517.61
8.1.00.0030.00517.55
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00818.37
8.0.270.0000.00817.27
8.0.260.0070.00016.88
8.0.250.0030.00316.94
8.0.240.0040.00417.07
8.0.230.0000.00917.06
8.0.220.0030.00316.87
8.0.210.0000.00716.88
8.0.200.0030.00317.10
8.0.190.0030.00517.02
8.0.180.0030.00616.98
8.0.170.0000.00716.95
8.0.160.0040.00416.99
8.0.150.0070.00016.94
8.0.140.0040.00416.81
8.0.130.0030.00313.38
8.0.120.0080.00016.94
8.0.110.0070.00016.98
8.0.100.0000.00716.83
8.0.90.0040.00416.86
8.0.80.0040.01716.94
8.0.70.0000.00816.84
8.0.60.0030.00616.88
8.0.50.0000.00716.79
8.0.30.0090.00917.11
8.0.20.0150.00617.40
8.0.10.0040.00417.00
8.0.00.0100.01416.98
7.4.330.0050.00015.55
7.4.320.0000.00616.37
7.4.300.0060.00016.52
7.4.290.0050.00316.56
7.4.280.0050.00316.63
7.4.270.0030.00316.52
7.4.260.0000.00716.54
7.4.250.0000.00716.61
7.4.240.0000.00716.37
7.4.230.0050.00216.65
7.4.220.0120.00616.65
7.4.210.0110.00716.60
7.4.200.0030.00316.63
7.4.160.0110.00616.57
7.4.150.0080.01117.40
7.4.140.0110.01217.86
7.4.130.0060.01216.52
7.4.120.0100.00716.59
7.4.110.0130.00316.53
7.4.100.0070.01416.42
7.4.90.0140.00616.55
7.4.80.0100.00719.39
7.4.70.0120.00316.59
7.4.60.0090.00616.52
7.4.50.0160.00016.60
7.4.40.0160.00016.60
7.4.30.0030.01316.75
7.4.00.0060.01014.93
7.3.330.0050.00313.36
7.3.320.0000.00613.16
7.3.310.0070.00016.32
7.3.300.0060.00016.27
7.3.290.0100.00516.38
7.3.280.0100.00716.36
7.3.270.0130.00317.40
7.3.260.0090.01016.38
7.3.250.0120.00816.36
7.3.240.0130.00616.30
7.3.230.0100.00716.30
7.3.210.0100.00716.47
7.3.200.0060.01016.41
7.3.190.0080.00816.61
7.3.180.0000.01516.42
7.3.170.0100.00716.48
7.3.160.0060.01116.34
7.3.120.0050.01215.01
7.3.110.0070.00714.75
7.3.100.0090.00714.86
7.3.90.0060.00915.08
7.3.80.0030.00914.72
7.3.70.0090.00614.77
7.3.60.0050.00714.90
7.3.50.0070.00714.79
7.3.40.0050.00614.88
7.3.30.0000.01414.63
7.3.20.0090.00416.66
7.3.10.0060.00716.87
7.3.00.0030.01116.56
7.2.330.0130.00416.57
7.2.320.0100.01316.35
7.2.310.0130.00316.44
7.2.300.0030.01416.55
7.2.290.0140.00816.78
7.2.250.0120.00715.14
7.2.240.0100.01014.79
7.2.230.0090.00814.89
7.2.220.0060.00714.82
7.2.210.0050.00614.91
7.2.200.0040.01114.94
7.2.190.0080.00614.97
7.2.180.0060.00815.00
7.2.170.0070.00714.83
7.2.60.0160.00016.66
7.2.00.0000.01219.19
7.1.330.0030.01115.56
7.1.320.0080.00515.66
7.1.310.0080.00715.80
7.1.300.0050.00915.63
7.1.290.0040.00915.71
7.1.280.0090.00515.62
7.1.270.0060.00615.43
7.1.260.0040.01015.77
7.1.200.0030.00915.72
7.1.100.0000.01017.73
7.1.70.0130.01017.06
7.1.60.0260.01534.93
7.1.50.0180.01834.76
7.1.40.0190.01334.07
7.1.30.0240.01234.35
7.1.20.0150.02134.52
7.1.10.0090.01216.61
7.1.00.0070.01316.54
7.0.200.0140.00616.89
7.0.190.0130.01216.56
7.0.180.0100.01016.34
7.0.170.0060.01616.34
7.0.160.0000.01916.36
7.0.150.0110.00916.21
7.0.140.0160.01316.36
7.0.130.0150.00916.40
7.0.120.0070.01716.60
7.0.110.0060.01816.29
7.0.100.0100.01316.25
7.0.90.0130.01016.31
7.0.80.0050.01716.49
7.0.70.0030.01416.18
7.0.60.0030.01415.94
7.0.50.0070.01816.18
7.0.40.0110.00716.34
7.0.30.0140.00716.42
7.0.20.0030.01316.50
7.0.10.0090.00916.28
7.0.00.0070.01016.23

preferences:
42.94 ms | 401 KiB | 5 Q