3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = 1; public function bar(?int $bar = null): Foo { $this->bar = $bar ?? $this->bar; return $this; } public function copy(?int $bar = null): Foo { return $this->fork()->bar($bar ?? $this->bar); } public function fork(): Foo { return clone $this; } } $a = new foo(); $a2 = $a->copy(); $b = $a->copy(2); $b2 = $a->copy(); $c = $b->copy(3); $c2 = $b->copy(); var_dump( $a->bar, $a2->bar, $b->bar, $b2->bar, $c->bar, $c2->bar );

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.5.00.0090.01120.21
8.4.150.0020.00014.05
8.4.140.0100.01217.57
8.4.130.0140.00617.64
8.4.120.0100.01120.64
8.4.110.0140.00620.51
8.4.100.0090.00817.77
8.4.90.0100.01020.43
8.4.80.0050.00618.77
8.4.70.0090.01020.65
8.4.60.0130.00920.63
8.4.50.0090.00920.55
8.4.40.0030.01717.68
8.4.30.0130.00718.86
8.4.20.0150.00418.85
8.4.10.0000.01019.41
8.3.280.0110.00918.31
8.3.270.0080.01116.70
8.3.260.0100.01016.38
8.3.250.0060.00218.84
8.3.240.0130.00516.52
8.3.230.0120.00816.57
8.3.220.0120.00418.87
8.3.210.0070.00716.73
8.3.200.0060.00216.77
8.3.190.0040.00317.07
8.3.180.0110.00818.87
8.3.170.0040.00417.21
8.3.160.0100.00717.12
8.3.150.0080.00016.54
8.3.140.0100.00316.61
8.3.130.0110.00018.38
8.3.120.0090.00018.88
8.3.110.0070.00316.76
8.3.100.0140.00424.06
8.3.90.0030.00526.77
8.3.80.0000.00916.63
8.3.70.0110.00716.38
8.3.60.0110.01116.50
8.3.50.0040.01123.65
8.3.40.0090.00618.69
8.3.30.0110.00418.75
8.3.20.0040.00421.07
8.3.10.0000.00720.31
8.3.00.0050.00320.65
8.2.290.0080.01017.10
8.2.280.0110.00818.43
8.2.270.0140.00716.45
8.2.260.0070.01117.27
8.2.250.0040.01416.56
8.2.240.0100.00017.34
8.2.230.0060.00320.94
8.2.220.0130.00337.54
8.2.210.0070.00726.77
8.2.200.0060.00316.75
8.2.190.0180.00016.75
8.2.180.0040.01118.25
8.2.170.0090.00622.96
8.2.160.0110.00320.57
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0060.00319.76
8.2.110.0060.00321.18
8.2.100.0000.01117.78
8.2.90.0060.00319.89
8.2.80.0040.00420.59
8.2.70.0040.00417.63
8.2.60.0000.00817.50
8.2.50.0030.00618.05
8.2.40.0050.00318.16
8.2.30.0050.00319.38
8.2.20.0040.00418.11
8.2.10.0000.00719.27
8.2.00.0040.00419.19
8.1.330.0140.00416.41
8.1.320.0120.00717.91
8.1.310.0070.01016.55
8.1.300.0060.01018.57
8.1.290.0000.00918.88
8.1.280.0100.00725.92
8.1.270.0000.00822.04
8.1.260.0050.00326.35
8.1.250.0030.01028.09
8.1.240.0090.00022.02
8.1.230.0120.00020.96
8.1.220.0060.00317.74
8.1.210.0080.00018.85
8.1.200.0040.00417.35
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0080.00018.78
8.1.150.0050.00318.78
8.1.140.0050.00218.80
8.1.130.0030.00321.80
8.1.120.0040.00417.32
8.1.110.0040.00417.36
8.1.100.0000.00817.41
8.1.90.0000.00717.45
8.1.80.0000.00817.33
8.1.70.0000.00717.39
8.1.60.0040.00417.49
8.1.50.0000.00817.46
8.1.40.0000.00817.48
8.1.30.0000.00817.66
8.1.20.0030.00517.57
8.1.10.0000.00817.57
8.1.00.0020.00517.53
8.0.300.0040.00420.16
8.0.290.0040.00416.63
8.0.280.0070.00018.44
8.0.270.0080.00018.01
8.0.260.0000.00719.95
8.0.250.0000.00716.81
8.0.240.0030.00616.87
8.0.230.0000.00716.79
8.0.220.0000.00816.75
8.0.210.0000.00716.88
8.0.200.0070.00016.77
8.0.190.0040.00416.75
8.0.180.0030.00516.75
8.0.170.0030.00716.89
8.0.160.0040.00416.86
8.0.150.0030.00516.77
8.0.140.0040.00416.68
8.0.130.0050.00013.21
8.0.120.0040.00416.85
8.0.110.0040.00416.86
8.0.100.0000.00716.82
8.0.90.0040.00416.69
8.0.80.0040.01516.80
8.0.70.0050.00316.82
8.0.60.0030.00316.80
8.0.50.0070.00316.90
8.0.30.0030.01316.88
8.0.20.0080.02817.08
8.0.10.0040.00417.02
8.0.00.0130.01116.41
7.4.330.0000.00515.55
7.4.320.0030.00316.56
7.4.300.0030.00316.50
7.4.290.0070.00316.56
7.4.280.0060.00616.52
7.4.270.0000.01116.61
7.4.260.0030.00313.25
7.4.250.0000.00716.58
7.4.240.0060.00216.62
7.4.230.0040.00416.51
7.4.220.0000.00716.49
7.4.210.0060.01016.58
7.4.200.0030.00316.70
7.4.130.0130.00816.60
7.4.120.0170.00716.41
7.4.110.0110.00716.42
7.4.100.0070.01016.38
7.4.90.0100.00716.64
7.4.80.0150.00319.39
7.4.70.0180.00616.48
7.4.60.0080.00816.47
7.4.50.0090.00616.48
7.4.40.0110.00816.31
7.4.30.0110.00516.23
7.4.20.0140.00816.28
7.4.10.0110.00616.29
7.4.00.0100.00716.53
7.3.330.0030.00316.35
7.3.320.0030.00313.24
7.3.310.0000.00716.31
7.3.300.0040.00416.27
7.3.290.0100.00816.27
7.3.260.0180.00316.44
7.3.240.0110.00516.49
7.3.230.0100.00716.48
7.3.210.0120.00916.56
7.3.200.0060.00916.46
7.3.190.0110.00816.48
7.3.180.0110.00716.38
7.3.170.0110.01116.29
7.3.160.0090.00616.31
7.3.150.0080.00816.40
7.3.140.0140.00716.41
7.3.130.0130.00316.50
7.3.120.0090.00916.21
7.3.110.0070.00716.37
7.3.100.0030.01716.18
7.3.90.0110.00416.13
7.3.80.0080.00816.21
7.3.70.0070.01316.29
7.3.60.0110.01116.27
7.3.50.0120.01216.50
7.3.40.0130.00816.27
7.3.30.0030.01516.20
7.3.20.0060.01216.44
7.3.10.0110.00916.36
7.3.00.0110.01116.41
7.2.330.0090.01516.75
7.2.320.0170.00316.68
7.2.310.0030.01316.50
7.2.300.0180.00016.72
7.2.290.0000.02116.58
7.2.280.0110.00716.62
7.2.270.0130.00316.29
7.2.260.0070.01016.59
7.2.250.0110.00616.33
7.2.240.0080.00816.24
7.2.230.0040.01316.64
7.2.220.0090.00916.63
7.2.210.0110.01116.39
7.2.200.0130.00816.48
7.2.190.0070.01516.48
7.2.180.0000.01816.61
7.2.170.0090.01116.48
7.2.160.0100.00616.51
7.2.150.0150.00816.41
7.2.140.0100.01316.53
7.2.130.0130.00316.47
7.2.120.0120.00416.53
7.2.110.0100.00716.71
7.2.100.0000.01716.52
7.2.90.0030.01316.59
7.2.80.0140.01116.48
7.2.70.0100.00616.54
7.2.60.0130.00816.36
7.2.50.0070.01116.64
7.2.40.0080.01216.71
7.2.30.0040.01116.74
7.2.20.0060.00916.80
7.2.10.0130.00316.56
7.2.00.0080.00816.53

preferences:
165.82 ms | 403 KiB | 5 Q