3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $x; public $y; public function __construct($x, $y) { $this->x = sha1($x); $this->y = $y; } public function __clone() { return new A($this->x, $this->y); } } class B extends A { public $z; public function __construct($z, $parent_obj) { $this->z = $z; parent::__construct($parent_obj->x, $parent_obj->y); } public function doSomeThing() { $parent_a_array = (array) parent::__clone(); var_dump($parent_a_array); $child_a_array = array_diff_assoc((array) $this, $parent_a_array); var_dump($child_a_array); echo "Parent Array Printing :\n"; foreach ($parent_a_array as $key => $value) { echo "Key: $key; Value: $value\n"; } echo "\nChild Array Printing: \n"; foreach ($child_a_array as $key => $value) { echo "Key: $key; Value: $value\n"; } } } $t = new B('C', new A("A", "B")); $t->doSomeThing();

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.70.0130.00918.43
8.3.60.0110.00416.75
8.3.50.0110.00722.99
8.3.40.0040.01118.97
8.3.30.0150.00018.86
8.3.20.0040.00419.15
8.3.10.0000.00821.89
8.3.00.0000.00821.00
8.2.190.0090.00916.58
8.2.180.0060.01016.63
8.2.170.0060.00922.96
8.2.160.0110.00420.43
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0080.00020.99
8.2.120.0070.00026.35
8.2.110.0060.00322.07
8.2.100.0040.00817.72
8.2.90.0000.00819.21
8.2.80.0000.01017.97
8.2.70.0060.00317.93
8.2.60.0050.00317.80
8.2.50.0040.00418.10
8.2.40.0000.00720.57
8.2.30.0040.00419.36
8.2.20.0050.00318.11
8.2.10.0040.00418.16
8.2.00.0000.00717.63
8.1.280.0040.01125.92
8.1.270.0080.00022.11
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0030.00620.70
8.1.230.0110.00417.70
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0090.00017.38
8.1.190.0040.00417.36
8.1.180.0080.00018.10
8.1.170.0000.00818.83
8.1.160.0050.00318.87
8.1.150.0000.00820.24
8.1.140.0040.00419.57
8.1.130.0000.00719.11
8.1.120.0050.00217.41
8.1.110.0050.00217.42
8.1.100.0000.00717.38
8.1.90.0040.00417.39
8.1.80.0040.00417.47
8.1.70.0040.00417.48
8.1.60.0040.00417.52
8.1.50.0090.00017.49
8.1.40.0000.00817.52
8.1.30.0060.00317.63
8.1.20.0050.00317.65
8.1.10.0040.00817.63
8.1.00.0040.00417.57
8.0.300.0040.00419.89
8.0.290.0060.00316.88
8.0.280.0030.00318.48
8.0.270.0000.00717.22
8.0.260.0030.00316.77
8.0.250.0030.00317.08
8.0.240.0000.00716.96
8.0.230.0030.00616.87
8.0.220.0030.00316.84
8.0.210.0000.00816.85
8.0.200.0000.00716.91
8.0.190.0030.00517.04
8.0.180.0050.00216.89
8.0.170.0000.00816.85
8.0.160.0030.00316.89
8.0.150.0030.00516.83
8.0.140.0000.00716.89
8.0.130.0030.00313.35
8.0.120.0040.00416.88
8.0.110.0000.00716.81
8.0.100.0000.00716.88
8.0.90.0050.00216.71
8.0.80.0060.00916.87
8.0.70.0000.00716.88
8.0.60.0030.00516.93
8.0.50.0040.00416.80
8.0.30.0130.00717.09
8.0.20.0110.00817.40
8.0.10.0000.00817.09
8.0.00.0130.01016.86
7.4.330.0030.00315.55
7.4.320.0030.00316.63
7.4.300.0020.00516.55
7.4.290.0000.00716.54
7.4.280.0040.00416.44
7.4.270.0000.00716.44
7.4.260.0050.00316.41
7.4.250.0070.00016.57
7.4.240.0040.00416.55
7.4.230.0040.00416.55
7.4.220.0100.01016.60
7.4.210.0050.01216.49
7.4.200.0000.00816.53
7.4.160.0120.00416.49
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0090.00916.56
7.4.120.0040.01316.56
7.4.110.0100.01316.48
7.4.100.0070.01416.43
7.4.90.0150.00316.63
7.4.80.0090.00919.39
7.4.70.0080.01216.63
7.4.60.0090.00616.46
7.4.50.0030.01416.65
7.4.40.0100.01016.47
7.4.30.0120.00616.74
7.4.00.0030.01514.91
7.3.330.0000.00513.21
7.3.320.0060.00013.35
7.3.310.0030.00316.21
7.3.300.0000.00716.32
7.3.290.0040.00416.32
7.3.280.0060.01016.39
7.3.270.0090.00917.40
7.3.260.0080.01316.68
7.3.250.0110.00816.51
7.3.240.0120.00816.36
7.3.230.0130.00616.55
7.3.210.0130.00716.71
7.3.200.0120.00916.39
7.3.190.0140.00316.50
7.3.180.0090.00616.28
7.3.170.0120.00616.66
7.3.160.0070.01016.69
7.2.330.0130.00616.93
7.2.320.0100.00716.73
7.2.310.0070.01016.88
7.2.300.0100.01016.58
7.2.290.0030.01816.73
7.2.60.0040.01116.71
7.2.50.0100.00617.00
7.2.00.0040.01119.53
7.1.200.0120.00015.88
7.1.70.0000.00817.27
7.1.60.0000.01417.32
7.1.00.0100.07022.43
7.0.200.0030.01316.82
7.0.130.0030.06722.18
7.0.120.0100.05322.06
7.0.110.0070.05722.06
7.0.100.0100.05722.09
7.0.90.0070.06322.11
7.0.80.0070.06322.11
7.0.70.0000.06722.04
7.0.60.0100.05321.69
7.0.50.0070.06322.12
7.0.40.0030.07321.98
7.0.30.0100.05722.07
7.0.20.0070.05722.05
7.0.10.0070.05722.05
7.0.00.0170.05021.96
5.6.280.0070.07720.94
5.6.270.0030.07321.07
5.6.260.0030.06021.04
5.6.250.0130.06721.08
5.6.240.0230.06320.89
5.6.230.0130.05320.84
5.6.220.0100.05720.98
5.6.210.0130.05020.99
5.6.200.0100.07021.03
5.6.190.0130.07020.80
5.6.180.0130.06020.83
5.6.170.0170.04721.04
5.6.160.0070.06020.79
5.6.150.0100.07320.80
5.6.140.0070.06021.06
5.6.130.0070.05720.85
5.6.120.0070.06020.92
5.6.110.0130.06720.93
5.6.100.0100.07321.00
5.6.90.0130.07020.82
5.6.80.0170.06320.45
5.6.70.0170.04720.44
5.6.60.0030.06020.13
5.6.50.0070.05320.40
5.6.40.0070.05720.45
5.6.30.0100.05320.42
5.6.20.0070.05720.45
5.6.10.0130.04720.38
5.6.00.0070.05720.32

preferences:
53.4 ms | 401 KiB | 5 Q