3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Point { public function __construct(private int $x, private int $y) {} protected function modClone(...$args): static { $new = clone($this); foreach ($args as $k => $v) { $new->$k = $v; } return $new; } public function moveUp(int $amt) { return $this->modClone(y: $this->y + $amt); } } $p1 = new Point(3, 5); $p2 = $p1->moveUp(4); var_dump($p2);

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.0120.00916.61
8.3.50.0090.00916.38
8.3.40.0040.01422.02
8.3.30.0120.00318.67
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0000.00726.16
8.2.180.0160.00325.92
8.2.170.0160.00620.60
8.2.160.0000.01522.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00420.80
8.2.110.0090.00020.52
8.2.100.0040.00718.89
8.1.280.0130.00725.92
8.1.270.0050.00323.99
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0070.00418.62
8.1.230.0090.00318.49
7.4.110.0140.00316.30
7.4.100.0100.00616.45
7.4.90.0130.00316.40
7.4.80.0070.01116.23
7.4.70.0110.00616.26
7.4.60.0090.00916.20
7.4.50.0170.00016.39
7.4.40.0120.00616.11
7.4.30.0100.00916.61
7.4.20.0030.01416.31
7.4.10.0120.00616.33
7.4.00.0070.01016.14
7.3.230.0130.00316.37
7.3.220.0090.00616.09
7.3.210.0060.00916.05
7.3.200.0080.00816.25
7.3.190.0060.01216.22
7.3.180.0130.00416.27
7.3.170.0090.00916.18
7.3.160.0170.00016.09
7.3.150.0110.01116.27
7.3.140.0070.01016.15
7.3.130.0120.00616.23
7.3.120.0160.00016.29
7.3.110.0090.00916.38
7.3.100.0110.00616.11
7.3.90.0120.00316.30
7.3.80.0040.01316.04
7.3.70.0080.00816.14
7.3.60.0160.00016.23
7.3.50.0110.00616.11
7.3.40.0070.01016.41
7.3.30.0090.00916.18
7.3.20.0160.00316.27
7.3.10.0120.00616.30
7.3.00.0080.01216.09
7.2.340.0070.01016.20
7.2.330.0100.00716.31
7.2.320.0070.01016.50
7.2.310.0070.01116.14
7.2.300.0130.00316.19
7.2.290.0050.01116.11
7.2.280.0030.01316.27
7.2.270.0100.00616.15
7.2.260.0030.01316.11
7.2.250.0140.00616.22
7.2.240.0090.00816.15
7.2.230.0060.00916.38
7.2.220.0100.00616.49
7.2.210.0030.01316.07
7.2.200.0110.00616.36
7.2.190.0060.01216.34
7.2.180.0120.00616.39
7.2.170.0030.01316.29
7.2.160.0170.00316.23
7.2.150.0190.00616.29
7.2.140.0090.00916.14
7.2.130.0070.01016.44
7.2.120.0070.01016.29
7.2.110.0160.00616.44
7.2.100.0070.01016.25
7.2.90.0130.00616.50
7.2.80.0060.01416.35
7.2.70.0090.00916.13
7.2.60.0060.01216.20
7.2.50.0160.01016.42
7.2.40.0070.01016.36
7.2.30.0070.01416.53
7.2.20.0170.00816.30
7.2.10.0120.01216.26
7.2.00.0100.01016.33

preferences:
26.94 ms | 400 KiB | 5 Q