3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct(public string $bar, public string $baz) {} private function cloneModify(...$args) { $new = clone($this); foreach ($args as $k => $v) { $new->$k = $v; } return $new; } public function withBar(string $bar) { return $this->cloneModify(bar: $bar); } } $f = new Foo('a', 'b'); $f2 = $f->withBar('beep'); var_dump($f2);

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.30.0110.00617.23
8.5.20.0100.00719.40
8.5.10.0100.00816.54
8.5.00.0110.01319.67
8.4.180.0110.01419.67
8.4.170.0160.00523.69
8.4.160.0130.01023.63
8.4.150.0060.00616.79
8.4.140.0130.00917.66
8.4.130.0100.00717.69
8.4.120.0040.00420.52
8.4.110.0110.00922.66
8.4.100.0170.00417.71
8.4.90.0110.01018.69
8.4.80.0040.00620.72
8.4.70.0110.00317.80
8.4.60.0090.01118.83
8.4.50.0060.00817.79
8.4.40.0130.00717.60
8.4.30.0040.00420.42
8.4.20.0130.00317.84
8.4.10.0060.00319.34
8.3.300.0120.00822.55
8.3.290.0120.00820.94
8.3.280.0080.01218.41
8.3.270.0100.01016.76
8.3.260.0150.00416.66
8.3.250.0080.01018.98
8.3.240.0070.00316.63
8.3.230.0070.01216.59
8.3.220.0040.00417.35
8.3.210.0130.00516.70
8.3.200.0070.00116.55
8.3.190.0100.00618.91
8.3.180.0120.00916.60
8.3.170.0030.00717.06
8.3.160.0060.01016.47
8.3.150.0070.01117.08
8.3.140.0160.00318.49
8.3.130.0130.00316.55
8.3.120.0040.00418.83
8.3.110.0030.00620.94
8.3.100.0000.00924.06
8.3.90.0040.00426.77
8.3.80.0060.00319.36
8.3.70.0070.01018.43
8.3.60.0140.00718.68
8.3.50.0090.01023.57
8.3.40.0130.00921.87
8.3.30.0100.01018.68
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.300.0120.01018.53
8.2.290.0120.00820.43
8.2.280.0110.00818.55
8.2.270.0000.01419.06
8.2.260.0140.00318.76
8.2.250.0050.00316.91
8.2.240.0040.00418.35
8.2.230.0060.00622.58
8.2.220.0060.01037.54
8.2.210.0090.00926.77
8.2.200.0090.00018.88
8.2.190.0150.00316.61
8.2.180.0080.00825.92
8.2.170.0070.01419.02
8.2.160.0150.00022.96
8.2.150.0040.00425.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00420.95
8.2.110.0030.00720.53
8.2.100.0030.00719.00
8.1.340.0120.00821.59
8.1.330.0140.00521.95
8.1.320.0100.00916.13
8.1.310.0150.00316.66
8.1.300.0080.00016.05
8.1.290.0030.00630.84
8.1.280.0140.00025.92
8.1.270.0000.00723.99
8.1.260.0050.00326.35
8.1.250.0070.01128.09
8.1.240.0080.00318.49
8.1.230.0060.00318.66
7.4.120.0240.01516.51
7.4.110.0250.01216.36
7.4.100.0220.01016.17
7.4.90.0240.01116.46
7.4.80.0300.00616.41
7.4.70.0200.01316.35
7.4.60.0260.00416.42
7.4.50.0240.00716.31
7.4.40.0160.02016.22
7.4.30.0270.01116.46
7.4.20.0210.00916.21
7.4.10.0180.01116.36
7.4.00.0090.00916.35
7.3.240.0120.00916.16
7.3.230.0220.01616.12
7.3.220.0350.00416.37
7.3.210.0250.00916.30
7.3.200.0280.00416.20
7.3.190.0240.01216.27
7.3.180.0170.02016.18
7.3.170.0320.01116.37
7.3.160.0270.00616.38
7.3.150.0230.01016.23
7.3.140.0250.00716.29
7.3.130.0210.01216.45
7.3.120.0210.01416.33
7.3.110.0280.01016.29
7.3.100.0280.00816.30
7.3.90.0210.01316.14
7.3.80.0230.01016.17
7.3.70.0350.00016.26
7.3.60.0300.00716.24
7.3.50.0300.00616.09
7.3.40.0280.00016.13
7.3.30.0190.01316.16
7.3.20.0310.00916.08
7.3.10.0220.01716.32
7.3.00.0280.00516.23
7.2.340.0300.00316.47
7.2.330.0250.01116.24
7.2.320.0220.01116.24
7.2.310.0280.00616.39
7.2.300.0190.02216.27
7.2.290.0220.01616.41
7.2.280.0200.01016.33
7.2.270.0240.00716.36
7.2.260.0210.01516.49
7.2.250.0300.00316.54
7.2.240.0190.02016.38
7.2.230.0130.01916.40
7.2.220.0290.00716.36
7.2.210.0060.01216.34
7.2.200.0240.01016.43
7.2.190.0210.01316.28
7.2.180.0230.00816.29
7.2.170.0290.00316.26
7.2.160.0200.01216.21
7.2.150.0600.01416.54
7.2.140.0320.01216.48
7.2.130.0210.01116.39
7.2.120.0350.00316.27
7.2.110.0290.00816.33
7.2.100.0240.01416.36
7.2.90.0250.01316.20
7.2.80.0280.01616.50
7.2.70.0310.00616.30
7.2.60.0300.00416.07
7.2.50.0280.01016.51
7.2.40.0260.01316.45
7.2.30.0270.01116.53
7.2.20.0230.00916.27
7.2.10.0230.01316.34
7.2.00.0130.01015.73

preferences:
82.67 ms | 1169 KiB | 5 Q