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.4.140.0080.00217.66
8.4.130.0080.00317.66
8.4.120.0100.01120.83
8.4.110.0110.00920.33
8.4.100.0120.00817.59
8.4.90.0130.00720.80
8.4.80.0110.00919.15
8.4.70.0100.01017.57
8.4.60.0120.00819.04
8.4.50.0080.00317.84
8.4.40.0130.00717.54
8.4.30.0160.00320.59
8.4.20.0040.00717.49
8.4.10.0000.00919.48
8.3.270.0110.01016.71
8.3.260.0130.00716.60
8.3.250.0040.00419.04
8.3.240.0110.00816.54
8.3.230.0120.00916.65
8.3.220.0110.00819.06
8.3.210.0140.00616.86
8.3.200.0050.00416.74
8.3.190.0130.00618.09
8.3.180.0090.00716.67
8.3.170.0120.00316.75
8.3.160.0090.00916.61
8.3.150.0090.00916.73
8.3.140.0130.00320.78
8.3.130.0000.00916.60
8.3.120.0090.00618.92
8.3.110.0000.00820.94
8.3.100.0120.00616.86
8.3.90.0000.00826.77
8.3.80.0030.00618.56
8.3.70.0130.00316.75
8.3.60.0120.00916.61
8.3.50.0110.00823.61
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.290.0140.00416.79
8.2.280.0080.00818.20
8.2.270.0070.01118.73
8.2.260.0100.00717.05
8.2.250.0120.00318.26
8.2.240.0080.00417.17
8.2.230.0080.00022.58
8.2.220.0000.01024.06
8.2.210.0060.00326.77
8.2.200.0050.00316.75
8.2.190.0200.00316.63
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.330.0040.00416.25
8.1.320.0090.00716.09
8.1.310.0080.00016.51
8.1.300.0070.00417.63
8.1.290.0060.00330.84
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:
93.14 ms | 403 KiB | 5 Q