3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 'Child' object. class Child { public $property = 'foo'; } // 'Parent' object. class ParentA implements Serializable { public $rofl = 'foo'; public function serialize() { return serialize(array($this->rofl)); } public function unserialize($data) { list($this->rofl) = unserialize($data); } } class ParentB extends ParentA { public $collection; public function __construct(array $items) { $this->collection = array(); foreach ($items as $item) { $this->collection[] = $item; } } public function serialize() { return serialize(array( 'foo' => $this->collection, 'parent' => parent::serialize() )); } public function unserialize($data) { $data = unserialize($data); $this->collection = $data['foo']; parent::unserialize($data['parent']); } } // Wrapper object. class Wrapper { public $parent; public $children; public function __construct(ParentB $parent, array $children) { $this->parent = $parent; $this->children = array(); foreach ($children as $child) { $this->children[] = $child; } } } $children = [new Child(), new Child(), new Child()]; $parent = new ParentB($children); $wrapper = new Wrapper($parent, $children); $data = serialize($wrapper); var_dump(unserialize($data));

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.0170.00318.61
8.3.50.0110.00822.00
8.3.40.0140.00718.79
8.3.30.0150.00419.08
8.3.20.0050.00220.18
8.3.10.0080.00022.05
8.3.00.0080.00022.41
8.2.180.0120.00318.66
8.2.170.0000.01522.96
8.2.160.0140.00320.89
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00417.63
8.2.110.0060.00321.98
8.2.100.0080.00417.97
8.2.90.0040.00420.50
8.2.80.0000.00819.21
8.2.70.0040.00419.66
8.2.60.0030.00517.93
8.2.50.0050.00318.10
8.2.40.0080.00020.50
8.2.30.0000.00818.22
8.2.20.0040.00417.73
8.2.10.0040.00417.84
8.2.00.0040.00417.77
8.1.280.0100.01025.92
8.1.270.0070.00322.20
8.1.260.0040.00426.35
8.1.250.0140.00428.09
8.1.240.0050.00522.61
8.1.230.0060.00621.04
8.1.220.0000.00817.89
8.1.210.0040.00418.96
8.1.200.0060.00317.23
8.1.190.0050.00317.35
8.1.180.0030.00618.10
8.1.170.0030.00518.43
8.1.160.0040.00422.04
8.1.150.0060.00318.54
8.1.140.0000.00717.48
8.1.130.0000.00717.86
8.1.120.0040.00417.40
8.1.110.0000.00717.51
8.1.100.0070.00017.50
8.1.90.0070.00017.55
8.1.80.0040.00417.51
8.1.70.0030.00317.46
8.1.60.0040.00417.61
8.1.50.0050.00317.56
8.1.40.0030.00517.57
8.1.30.0000.00817.57
8.1.20.0030.00617.52
8.1.10.0000.00717.57
8.1.00.0000.00817.43
8.0.300.0040.00419.90
8.0.290.0060.00316.75
8.0.280.0040.00418.39
8.0.270.0040.00417.35
8.0.260.0000.00718.51
8.0.250.0000.00717.07
8.0.240.0050.00217.02
8.0.230.0000.00717.03
8.0.220.0000.00817.05
8.0.210.0030.00316.94
8.0.200.0070.00017.00
8.0.190.0040.00416.95
8.0.180.0040.00417.00
8.0.170.0080.00016.98
8.0.160.0040.00417.05
8.0.150.0000.00716.93
8.0.140.0040.00416.97
8.0.130.0030.00313.33
8.0.120.0060.00316.96
8.0.110.0040.00416.97
8.0.100.0040.00416.97
8.0.90.0040.00417.07
8.0.80.0090.00616.93
8.0.70.0070.00016.81
8.0.60.0000.00716.94
8.0.50.0050.00316.84
8.0.30.0160.00917.13
8.0.20.0150.00517.40
8.0.10.0040.00417.17
8.0.00.0100.00716.94
7.4.330.0020.00215.12
7.4.320.0000.00716.54
7.4.300.0030.00316.52
7.4.290.0070.00016.54
7.4.280.0030.00316.41
7.4.270.0030.00316.62
7.4.260.0000.00716.61
7.4.250.0020.00516.49
7.4.240.0020.00516.62
7.4.230.0070.00016.66
7.4.220.0070.01016.63
7.4.210.0070.01016.59
7.4.200.0020.00516.51
7.4.190.0050.00316.68
7.4.160.0090.00916.43
7.4.150.0140.01017.40
7.4.140.0120.00617.86
7.4.130.0070.01016.70
7.4.120.0070.01216.58
7.4.110.0100.01316.66
7.4.100.0130.01016.81
7.4.90.0090.00916.64
7.4.80.0110.00616.48
7.4.70.0100.00716.50
7.4.60.0180.00416.60
7.4.50.0050.00016.61
7.4.40.0060.00322.77
7.4.30.0070.01016.63
7.4.00.0100.00715.09
7.3.330.0030.00313.33
7.3.320.0050.00013.26
7.3.310.0040.00416.52
7.3.300.0000.00716.47
7.3.290.0100.00616.44
7.3.280.0090.01116.50
7.3.270.0030.01417.40
7.3.260.0070.01116.63
7.3.250.0100.00716.43
7.3.240.0130.01016.71
7.3.230.0100.00716.59
7.3.210.0130.01016.70
7.3.200.0130.00619.39
7.3.190.0090.00916.42
7.3.180.0060.01016.71
7.3.170.0030.01316.41
7.3.160.0070.01016.32
7.3.120.0070.01015.20
7.2.330.0090.01016.91
7.2.320.0120.00616.80
7.2.310.0120.00916.64
7.2.300.0120.01216.47
7.2.290.0000.01716.82
7.2.60.0000.01516.52
7.2.00.0090.00619.61
7.1.200.0230.01415.32
7.1.100.0030.00718.35
7.1.70.0000.00917.11
7.1.60.0120.01219.82
7.1.50.0000.01617.02
7.1.00.0030.07322.40
7.0.200.0060.00616.86
7.0.140.0030.07022.07
7.0.70.0030.08721.76
7.0.60.0100.08021.75
7.0.50.0030.06322.16
7.0.40.0000.09020.10
7.0.30.0070.08020.14
7.0.20.0030.08720.00
7.0.10.0100.05320.02
7.0.00.0030.04320.08
5.6.280.0070.07021.17
5.6.220.0030.06020.70
5.6.210.0030.05320.64
5.6.200.0070.08021.04
5.6.190.0070.08321.09
5.6.180.0070.05021.02
5.6.170.0070.08721.03
5.6.160.0030.05020.96
5.6.150.0130.04021.05
5.6.140.0100.08021.19
5.6.130.0100.07320.96
5.6.120.0070.04721.03
5.6.110.0030.06721.02
5.6.100.0000.07321.02
5.6.90.0070.06020.93
5.6.80.0030.07720.45
5.6.70.0100.07320.46
5.6.60.0100.06720.46
5.6.50.0070.08320.38
5.6.40.0070.08020.31
5.6.30.0070.07320.41
5.6.20.0170.05320.44
5.6.10.0030.08320.40
5.6.00.0000.06720.38
5.5.360.0030.09020.58
5.5.350.0130.07320.46
5.5.340.0070.04720.76
5.5.330.0070.05720.91
5.5.320.0100.08320.80
5.5.310.0030.08720.77
5.5.300.0070.08320.86
5.5.290.0070.08720.95
5.5.280.0030.08020.77
5.5.270.0000.07720.65
5.5.260.0070.08020.88
5.5.250.0170.07320.71
5.5.240.0000.08320.15
5.5.230.0070.05020.19
5.5.220.0070.08020.17
5.5.210.0030.08320.17
5.5.200.0100.07020.19
5.5.190.0070.07320.27
5.5.180.0100.07320.24
5.5.160.0030.06320.14
5.5.150.0100.07320.23
5.5.140.0030.08320.19
5.5.130.0070.06320.23
5.5.120.0070.07720.14
5.5.110.0030.08020.21
5.5.100.0000.08320.19
5.5.90.0030.08320.08
5.5.80.0070.08020.17
5.5.70.0100.08020.10
5.5.60.0070.05320.07
5.5.50.0030.07720.17
5.5.40.0030.05720.13
5.5.30.0030.07020.16
5.5.20.0000.05020.11
5.5.10.0070.03719.99
5.5.00.0030.08320.13
5.4.450.0030.05019.36
5.4.440.0000.04719.38
5.4.430.0070.08019.34
5.4.420.0030.06719.45
5.4.410.0000.08019.45
5.4.400.0070.06319.18
5.4.390.0030.08019.04
5.4.380.0070.07719.14
5.4.370.0070.04318.88
5.4.360.0130.07019.25
5.4.350.0070.05719.05
5.4.340.0100.07019.04
5.4.320.0030.08318.91
5.4.310.0070.08019.13
5.4.300.0000.06319.20
5.4.290.0030.07718.84
5.4.280.0030.07718.94
5.4.270.0000.08319.09
5.4.260.0070.07319.18
5.4.250.0070.05719.12
5.4.240.0030.05019.23
5.4.230.0000.04719.22
5.4.220.0070.07719.11
5.4.210.0030.05019.03
5.4.200.0030.05319.13
5.4.190.0070.07019.08
5.4.180.0030.03719.21
5.4.170.0070.03319.19
5.4.160.0200.06719.21
5.4.150.0000.06319.21
5.4.140.0030.07016.43
5.4.130.0070.06716.34
5.4.120.0000.07016.44
5.4.110.0030.07716.41
5.4.100.0030.07716.39
5.4.90.0030.05716.49
5.4.80.0100.06716.36
5.4.70.0030.07716.45
5.4.60.0100.06016.48
5.4.50.0030.05316.46
5.4.40.0030.06316.54
5.4.30.0070.04316.53
5.4.20.0030.07016.46
5.4.10.0070.05716.45
5.4.00.0030.07715.95
5.3.290.0000.07715.80
5.3.280.0030.08015.80
5.3.270.0000.05315.80
5.3.260.0030.07715.80
5.3.250.0070.07315.80
5.3.240.0030.05315.80
5.3.230.0070.05015.80
5.3.220.0030.07715.80
5.3.210.0030.07715.80
5.3.200.0030.07715.80
5.3.190.0070.07015.80
5.3.180.0070.05015.80
5.3.170.0070.07315.80
5.3.160.0070.06015.80
5.3.150.0100.07315.80
5.3.140.0030.06015.80
5.3.130.0000.05715.80
5.3.120.0100.06715.80
5.3.110.0030.08315.80
5.3.100.0030.05715.80
5.3.90.0100.06715.80
5.3.80.0100.06715.80
5.3.70.0100.06015.80
5.3.60.0000.06015.80
5.3.50.0030.05315.80
5.3.40.0030.07315.80
5.3.30.0000.06715.80
5.3.20.0070.07015.80
5.3.10.0030.06015.80
5.3.00.0070.05315.80
5.2.170.0000.06315.80
5.2.160.0000.05315.80
5.2.150.0030.06315.80
5.2.140.0070.06015.80
5.2.130.0000.06315.80
5.2.120.0100.05715.80
5.2.110.0070.05715.80
5.2.100.0030.06315.80
5.2.90.0070.04315.80
5.2.80.0000.04715.80
5.2.70.0000.06315.80
5.2.60.0000.06715.80
5.2.50.0030.03715.80
5.2.40.0030.05715.80
5.2.30.0030.05315.80
5.2.20.0000.03015.80
5.2.10.0000.03015.80
5.2.00.0000.03015.80
5.1.60.0030.02015.80
5.1.50.0000.02315.80
5.1.40.0000.02315.80
5.1.30.0000.02715.80
5.1.20.0030.03315.80
5.1.10.0000.02715.80
5.1.00.0000.02715.80
5.0.50.0030.01715.80
5.0.40.0000.02015.80
5.0.30.0000.03015.80
5.0.20.0000.03015.80
5.0.10.0000.03715.80
5.0.00.0030.02715.80
4.4.90.0030.03315.80
4.4.80.0000.03715.80
4.4.70.0030.01715.80
4.4.60.0030.01715.80
4.4.50.0030.01315.80
4.4.40.0000.02315.80
4.4.30.0030.01315.80
4.4.20.0030.01315.80
4.4.10.0030.01315.80
4.4.00.0000.02715.80
4.3.110.0000.01315.80
4.3.100.0000.01315.80
4.3.90.0000.01715.80
4.3.80.0000.02715.80
4.3.70.0000.01315.80
4.3.60.0000.01715.80
4.3.50.0030.01315.80
4.3.40.0030.03315.80
4.3.30.0030.01315.80
4.3.20.0030.01315.80
4.3.10.0000.01715.80
4.3.00.0030.02315.80

preferences:
48.88 ms | 401 KiB | 5 Q