3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Traitor { public function cloneMutated($settings) { $object = clone $this; foreach ($settings as $name => $val) { $object->$name = $val; } return $object; } } class Q { use Traitor; private $foo; protected $bar; public function __construct($foo, $bar) { $this->foo = $foo; $this->bar = $bar; } } class Z extends Q { private $asd; } $a = new Z(1, 2); $b = $a->cloneMutated(["bar" => 3]); var_dump($b); $c = $a->cloneMutated(["asd" => 4]); var_dump($c);

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.0070.01116.88
8.3.50.0070.01121.26
8.3.40.0040.01118.88
8.3.30.0140.00718.97
8.3.20.0080.00020.52
8.3.10.0000.00921.93
8.3.00.0070.00022.51
8.2.180.0150.00416.50
8.2.170.0070.01122.96
8.2.160.0030.01020.44
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00017.63
8.2.110.0060.00319.30
8.2.100.0120.00017.75
8.2.90.0080.00019.23
8.2.80.0050.00317.97
8.2.70.0060.00317.50
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0030.00621.03
8.2.30.0030.00519.72
8.2.20.0000.00817.71
8.2.10.0050.00318.03
8.2.00.0070.00018.11
8.1.280.0090.00925.92
8.1.270.0040.00420.07
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0060.00322.25
8.1.230.0100.00317.48
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0090.00017.25
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0040.00418.59
8.1.160.0030.00522.02
8.1.150.0040.00419.00
8.1.140.0040.00417.36
8.1.130.0070.00017.61
8.1.120.0040.00417.50
8.1.110.0000.00717.48
8.1.100.0000.00717.46
8.1.90.0030.00517.39
8.1.80.0040.00417.45
8.1.70.0040.00417.46
8.1.60.0030.00617.61
8.1.50.0090.00017.51
8.1.40.0080.00017.52
8.1.30.0000.00917.63
8.1.20.0070.00017.56
8.1.10.0020.00517.46
8.1.00.0000.00717.43
8.0.300.0000.00718.77
8.0.290.0050.00316.88
8.0.280.0030.00318.36
8.0.270.0040.00417.34
8.0.260.0000.00617.19
8.0.250.0000.00817.04
8.0.240.0030.00316.91
8.0.230.0000.00717.04
8.0.220.0050.00316.81
8.0.210.0040.00316.98
8.0.200.0000.00717.00
8.0.190.0000.00816.98
8.0.180.0000.00716.98
8.0.170.0050.00316.98
8.0.160.0000.01016.98
8.0.150.0000.00716.81
8.0.140.0040.00416.93
8.0.130.0060.00013.32
8.0.120.0060.00316.89
8.0.110.0030.00516.92
8.0.100.0040.00416.86
8.0.90.0040.00416.96
8.0.80.0150.00016.98
8.0.70.0040.00416.79
8.0.60.0040.00416.83
8.0.50.0020.00516.98
8.0.30.0090.00917.16
8.0.20.0160.01017.40
8.0.10.0070.00017.05
8.0.00.0080.01116.81
7.4.330.0000.00515.09
7.4.320.0030.00316.41
7.4.300.0000.00616.56
7.4.290.0000.00716.59
7.4.280.0050.00316.47
7.4.270.0040.00416.59
7.4.260.0000.00716.51
7.4.250.0040.00416.52
7.4.240.0050.00216.47
7.4.230.0000.00716.72
7.4.220.0110.00716.58
7.4.210.0070.01216.47
7.4.200.0080.00016.34
7.4.160.0120.00316.54
7.4.150.0110.00717.40
7.4.140.0150.00817.86
7.4.130.0180.00516.61
7.4.120.0070.01216.54
7.4.110.0110.00616.44
7.4.100.0110.01116.64
7.4.90.0100.00816.73
7.4.80.0070.01019.39
7.4.70.0100.01016.62
7.4.60.0070.01016.45
7.4.50.0040.00416.32
7.4.40.0120.00616.41
7.4.30.0130.00316.61
7.4.00.0030.01415.17
7.3.330.0030.00313.27
7.3.320.0030.00213.34
7.3.310.0030.00316.21
7.3.300.0040.00416.33
7.3.290.0050.00316.22
7.3.280.0090.00816.33
7.3.270.0130.01217.40
7.3.260.0110.00616.67
7.3.250.0120.00816.45
7.3.240.0080.00816.47
7.3.230.0150.00316.57
7.3.210.0130.00416.27
7.3.200.0150.00319.39
7.3.190.0110.00716.50
7.3.180.0110.00416.53
7.3.170.0100.00616.55
7.3.160.0070.01016.39
7.2.330.0040.02116.60
7.2.320.0150.00916.77
7.2.310.0070.01116.49
7.2.300.0090.00916.41
7.2.290.0070.01416.62
7.2.60.0090.00616.79
7.2.00.0030.01219.64
7.1.200.0030.00615.52
7.1.100.0120.00318.14
7.1.70.0000.01217.25
7.1.60.0130.01320.03
7.1.50.0000.01317.08
7.1.00.0000.08022.57
7.0.200.0030.00616.51
7.0.60.0070.03719.96
7.0.50.0030.04017.89
7.0.40.0170.07320.20
7.0.30.0370.07020.34
7.0.20.0270.03320.12
7.0.10.0300.07720.23
7.0.00.0130.07720.07
5.6.280.0000.07721.04
5.6.210.0100.08320.51
5.6.200.0070.03718.25
5.6.190.0100.09020.34
5.6.180.0330.03720.63
5.6.170.0370.07320.47
5.6.160.0070.04020.39
5.6.150.0030.05718.19
5.6.140.0030.08318.21
5.6.130.0100.09318.15
5.6.120.0000.08320.98
5.6.110.0100.08321.00
5.6.100.0100.03721.08
5.6.90.0170.07720.99
5.6.80.0100.06720.41
5.6.70.0330.07020.52
5.5.350.0100.04020.43
5.5.340.0100.03718.08
5.5.330.0100.08720.32
5.5.320.0400.07320.25
5.5.310.0230.07020.30
5.5.300.0170.06317.98
5.5.290.0070.04717.98
5.5.280.0100.05020.88
5.5.270.0030.09020.65
5.5.260.0100.04720.88
5.5.250.0000.09020.47
5.5.240.0070.05720.26
5.4.450.0700.05019.70
5.4.440.0800.05019.38
5.4.430.0530.06019.41
5.4.420.0570.05719.55
5.4.410.0700.07019.29
5.4.400.0670.05719.38
5.4.390.0600.06019.28
5.4.380.0730.06319.29
5.4.370.0630.06719.29
5.4.360.0700.04719.00
5.4.350.0630.05319.25
5.4.340.0570.06319.28
5.4.320.0670.05718.85
5.4.310.0600.06019.30
5.4.300.0670.05319.01
5.4.290.0730.04718.83
5.4.280.0700.05319.28
5.4.270.0700.05018.84
5.4.260.0570.05718.84
5.4.250.0700.05719.05
5.4.240.0570.05719.05
5.4.230.0730.04319.25
5.4.220.0670.04719.09
5.4.210.0070.06019.01
5.4.200.0230.05316.73
5.4.190.0630.04719.13
5.4.180.0600.05719.24
5.4.170.0600.06018.86
5.4.160.0600.07019.09
5.4.150.0570.05318.99
5.4.140.0470.05316.57
5.4.130.0670.04316.38
5.4.120.0630.04716.59
5.4.110.0130.05316.36
5.4.100.0030.05316.56
5.4.90.0330.04716.47
5.4.80.0470.04716.55
5.4.70.0470.07316.60
5.4.60.0070.06716.17
5.4.50.0000.04316.60
5.4.40.0070.07016.37
5.4.30.0230.05016.52
5.4.20.0170.03716.27

preferences:
65.45 ms | 401 KiB | 5 Q