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([$this->rofl]); } public function unserialize($data) { list($this->rofl) = unserialize($data); } } class ParentB extends ParentA { public $collection; public function __construct(array $items) { $this->collection = []; foreach ($items as $item) { $this->collection[] = $item; } } public function serialize() { return serialize([ '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 = []; 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.70.0090.00616.63
8.3.60.0170.00316.61
8.3.50.0100.00622.15
8.3.40.0040.01118.92
8.3.30.0090.00619.00
8.3.20.0040.00420.33
8.3.10.0090.00023.53
8.3.00.0080.00020.77
8.2.180.0140.00316.75
8.2.170.0150.00618.94
8.2.160.0150.00422.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0000.00926.16
8.2.120.0040.00422.25
8.2.110.0040.00422.29
8.2.100.0120.00018.03
8.2.90.0000.00920.64
8.2.80.0050.00317.97
8.2.70.0030.00917.93
8.2.60.0050.00318.34
8.2.50.0060.00318.07
8.2.40.0060.00318.22
8.2.30.0060.00318.21
8.2.20.0000.00817.69
8.2.10.0000.00717.77
8.2.00.0040.00417.82
8.1.280.0190.00325.92
8.1.270.0090.00623.80
8.1.260.0050.00526.35
8.1.250.0040.00428.09
8.1.240.0050.00523.81
8.1.230.0040.00720.85
8.1.220.0040.00417.88
8.1.210.0000.00719.11
8.1.200.0060.00317.35
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0030.00618.46
8.1.160.0040.00422.04
8.1.150.0000.00818.59
8.1.140.0040.00417.53
8.1.130.0040.00417.85
8.1.120.0000.00717.54
8.1.110.0040.00417.45
8.1.100.0030.00517.41
8.1.90.0000.00917.47
8.1.80.0080.00017.47
8.1.70.0000.00817.42
8.1.60.0040.00417.56
8.1.50.0060.00317.54
8.1.40.0030.00617.53
8.1.30.0070.00017.54
8.1.20.0040.00417.74
8.1.10.0040.00417.64
8.1.00.0040.00417.41
8.0.300.0000.00719.98
8.0.290.0060.00316.88
8.0.280.0000.00718.54
8.0.270.0000.00816.79
8.0.260.0030.00316.92
8.0.250.0030.00317.08
8.0.240.0000.00717.02
8.0.230.0040.00416.93
8.0.220.0080.00016.85
8.0.210.0030.00316.99
8.0.200.0000.00616.91
8.0.190.0030.00616.92
8.0.180.0000.00716.86
8.0.170.0030.00517.04
8.0.160.0040.00416.82
8.0.150.0000.00816.92
8.0.140.0070.00316.93
8.0.130.0070.00013.45
8.0.120.0040.00416.95
8.0.110.0040.00416.94
8.0.100.0040.00416.83
8.0.90.0040.00416.88
8.0.80.0040.01116.95
8.0.70.0070.00017.02
8.0.60.0040.00417.03
8.0.50.0000.00816.96
8.0.30.0090.00916.94
8.0.20.0090.00917.40
8.0.10.0000.00817.00
8.0.00.0110.01016.83
7.4.330.0030.00315.08
7.4.320.0030.00316.54
7.4.300.0030.00316.62
7.4.290.0030.00316.63
7.4.280.0000.00716.60
7.4.270.0000.00616.64
7.4.260.0080.00016.61
7.4.250.0040.00416.59
7.4.240.0040.00316.55
7.4.230.0030.00316.63
7.4.220.0090.00616.67
7.4.210.0050.01416.58
7.4.200.0050.00316.59
7.4.190.0040.00416.79
7.4.160.0120.00616.33
7.4.150.0100.00717.40
7.4.140.0070.01317.86
7.4.130.0100.01216.69
7.4.120.0140.00316.62
7.4.110.0070.01016.56
7.4.100.0160.00616.54
7.4.90.0280.02416.64
7.4.80.0060.01319.39
7.4.70.0130.00316.48
7.4.60.0150.00816.43
7.4.50.0000.00516.46
7.4.40.0070.01122.77
7.4.30.0110.00516.57
7.4.00.0000.01614.95
7.3.330.0030.00313.29
7.3.320.0040.00413.46
7.3.310.0030.00316.52
7.3.300.0000.00716.40
7.3.290.0030.01316.43
7.3.280.0060.01016.49
7.3.270.0100.00717.40
7.3.260.0100.01316.45
7.3.250.0100.01016.56
7.3.240.0100.00616.65
7.3.230.0110.00516.39
7.3.210.0090.00916.71
7.3.200.0060.01819.39
7.3.190.0060.01216.64
7.3.180.0080.00816.39
7.3.170.0060.00916.54
7.3.160.0100.00716.67
7.3.120.0070.01114.97
7.3.00.0040.01116.80
7.2.330.0090.00916.72
7.2.320.0120.00616.53
7.2.310.0090.00916.67
7.2.300.0040.01216.66
7.2.290.0090.00916.94
7.2.130.0110.00316.97
7.2.120.0030.01417.06
7.2.110.0070.00316.72
7.2.100.0070.00316.98
7.2.90.0120.00317.04
7.2.80.0090.00317.14
7.2.70.0040.01117.04
7.2.60.0090.00217.01
7.2.50.0080.00416.85
7.2.40.0040.00816.93
7.2.30.0030.01016.51
7.2.20.0030.01216.70
7.2.10.0030.01416.98
7.2.00.0140.00016.99
7.1.250.0040.01115.58
7.1.240.0100.00715.65
7.1.230.0110.00015.92
7.1.220.0070.00715.77
7.1.210.0030.01015.88
7.1.200.0020.01015.93
7.1.190.0000.01315.88
7.1.180.0070.00715.71
7.1.170.0060.00915.91
7.1.160.0030.01015.77
7.1.150.0030.01015.76
7.1.140.0100.00315.93
7.1.130.0000.01215.81
7.1.120.0110.00415.89
7.1.110.0030.00915.65
7.1.100.0090.00616.00
7.1.90.0000.01115.64
7.1.80.0120.00315.99
7.1.70.0030.00616.51
7.1.60.0060.01017.45
7.1.50.0100.00925.36
7.1.40.0070.00715.98
7.1.30.0080.00015.45
7.1.20.0030.00715.69
7.1.10.0070.00715.93
7.1.00.0080.04119.05
7.0.330.0070.01015.33
7.0.320.0030.00815.27
7.0.310.0040.00415.43
7.0.300.0070.00415.18
7.0.290.0000.01215.34
7.0.280.0030.00915.26
7.0.270.0030.00515.15
7.0.260.0040.00815.00
7.0.250.0060.00615.27
7.0.240.0120.00315.37
7.0.230.0040.00715.53
7.0.220.0040.00715.23
7.0.210.0030.00715.12
7.0.200.0090.00916.00
7.0.190.0070.00015.27
7.0.180.0040.00715.45
7.0.170.0030.00915.11
7.0.160.0030.00615.44
7.0.150.0080.00415.48
7.0.140.0060.03518.79
7.0.130.0040.00815.52
7.0.120.0060.00615.50
7.0.110.0080.00415.22
7.0.100.0030.02417.68
7.0.90.0030.03117.64
7.0.80.0070.02017.66
7.0.70.0050.02417.55
7.0.60.0020.02717.62
7.0.50.0100.01817.82
7.0.40.0050.02516.70
7.0.30.0100.02016.80
7.0.20.0060.02316.67
7.0.10.0040.02116.76
7.0.00.0030.02616.78
5.6.380.0100.00314.29
5.6.370.0090.00614.56
5.6.360.0060.00614.46
5.6.350.0040.00814.71
5.6.340.0060.01014.47
5.6.330.0020.00714.27
5.6.320.0070.00414.11
5.6.310.0060.00614.55
5.6.300.0110.00414.55
5.6.290.0050.00314.35
5.6.280.0090.03317.68
5.6.270.0060.00614.08
5.6.260.0080.00414.24
5.6.250.0000.02417.43
5.6.240.0060.02117.46
5.6.230.0050.02317.39
5.6.220.0080.01917.45
5.6.210.0020.02517.35
5.6.200.0100.02117.44
5.6.190.0080.02317.76
5.6.180.0060.01817.63
5.6.170.0090.02117.91
5.6.160.0050.02217.77
5.6.150.0030.02117.62
5.6.140.0100.02017.89
5.6.130.0030.02617.71
5.6.120.0090.02117.80
5.6.110.0070.05317.64
5.6.100.0050.03717.75
5.6.90.0120.04017.80
5.6.80.0050.03517.38
5.6.70.0040.02517.32
5.6.60.0070.03517.37
5.6.50.0090.04017.35
5.6.40.0060.03917.41
5.6.30.0090.04017.48
5.6.20.0050.03717.22
5.6.10.0050.03517.37
5.6.00.0040.02817.36
5.5.380.0050.02315.84
5.5.370.0060.02315.81
5.5.360.0040.02315.81
5.5.350.0030.02115.86
5.5.340.0040.02316.03
5.5.330.0010.02416.11
5.5.320.0030.02316.11
5.5.310.0080.02215.98
5.5.300.0080.01516.00
5.5.290.0030.02116.01
5.5.280.0020.02416.18
5.5.270.0090.04316.15
5.5.260.0080.04516.05
5.5.250.0060.02015.93
5.5.240.0110.03815.83
5.5.230.0040.02415.81
5.5.220.0090.03015.72
5.5.210.0020.02915.77
5.5.200.0080.02515.86
5.5.190.0070.04215.69
5.5.180.0120.03215.73
5.5.170.0030.00511.18
5.5.160.0050.02215.79
5.5.150.0070.04015.71
5.5.140.0050.03215.63
5.5.130.0120.02815.80
5.5.120.0060.02215.71
5.5.110.0060.03615.81
5.5.100.0090.03015.68
5.5.90.0020.03015.62
5.5.80.0050.04015.56
5.5.70.0050.02415.63
5.5.60.0090.01715.56
5.5.50.0090.03515.64
5.5.40.0050.03915.63
5.5.30.0040.04115.70
5.5.20.0050.03215.62
5.5.10.0080.04015.61
5.5.00.0050.04015.61
5.4.450.0030.01815.42
5.4.440.0030.02015.34
5.4.430.0030.04615.51
5.4.420.0000.04315.30
5.4.410.0020.02915.26
5.4.400.0030.04215.08
5.4.390.0020.03815.21
5.4.380.0030.02515.09
5.4.370.0050.03015.11
5.4.360.0050.03815.03
5.4.350.0090.02015.19
5.4.340.0060.02415.19
5.4.330.0060.00311.18
5.4.320.0020.02415.15
5.4.310.0080.03315.10
5.4.300.0050.02215.13
5.4.290.0080.02115.13
5.4.280.0030.03315.11
5.4.270.0070.03015.11
5.4.260.0050.04215.10
5.4.250.0070.03915.11
5.4.240.0030.02815.15
5.4.230.0040.02915.01
5.4.220.0050.02315.20
5.4.210.0040.03015.15
5.4.200.0070.02515.15
5.4.190.0050.02315.14
5.4.180.0070.04315.11
5.4.170.0050.02515.16
5.4.160.0080.03715.03
5.4.150.0030.03315.12
5.4.140.0030.02513.80
5.4.130.0020.03313.70
5.4.120.0030.03513.77
5.4.110.0030.02813.86
5.4.100.0070.03613.79
5.4.90.0030.03213.80
5.4.80.0080.03213.80
5.4.70.0100.03713.80
5.4.60.0080.03713.81
5.4.50.0020.03813.74
5.4.40.0060.03913.78
5.4.30.0000.02713.83
5.4.20.0090.01813.83
5.4.10.0040.02413.87
5.4.00.0100.03013.57
5.3.290.0070.02512.93
5.3.280.0070.02812.92
5.3.270.0030.04012.87
5.3.260.0050.02312.94
5.3.250.0060.03612.90
5.3.240.0070.02012.86
5.3.230.0070.02312.87
5.3.220.0020.04012.93
5.3.210.0050.03712.85
5.3.200.0070.04912.86
5.3.190.0050.03012.90
5.3.180.0050.04112.86
5.3.170.0030.01912.92
5.3.160.0060.03512.89
5.3.150.0010.04512.86
5.3.140.0070.02312.93
5.3.130.0050.04012.91
5.3.120.0070.03712.84
5.3.110.0030.04112.87
5.3.100.0030.02712.66
5.3.90.0050.02712.59
5.3.80.0100.01712.64
5.3.70.0030.02512.59
5.3.60.0030.02312.58
5.3.50.0100.03712.62
5.3.40.0020.04012.57
5.3.30.0080.03712.58
5.3.20.0040.03012.45
5.3.10.0040.04112.48
5.3.00.0030.04012.41
5.2.170.0060.01511.17
5.2.160.0050.02211.19
5.2.150.0000.01811.09
5.2.140.0020.01711.17
5.2.130.0000.01611.13
5.2.120.0080.02311.19
5.2.110.0060.02511.08
5.2.100.0050.02411.08
5.2.90.0050.02511.11
5.2.80.0060.01511.14
5.2.70.0030.03311.21
5.2.60.0030.03311.17
5.2.50.0070.01811.14
5.2.40.0030.02311.05
5.2.30.0020.02211.09
5.2.20.0000.02511.08
5.2.10.0030.02410.99
5.2.00.0030.01710.94
5.1.60.0020.03010.93
5.1.50.0010.02110.93
5.1.40.0040.02110.93
5.1.30.0050.01810.93
5.1.20.0030.01810.93
5.1.10.0020.02410.93
5.1.00.0030.03010.93
5.0.50.0020.01910.93
5.0.40.0080.01510.93
5.0.30.0020.02110.93
5.0.20.0050.02010.93
5.0.10.0040.02310.93
5.0.00.0040.03210.93
4.4.90.0030.00510.93
4.4.80.0030.01810.93
4.4.70.0020.01210.93
4.4.60.0000.01910.93
4.4.50.0030.02010.93
4.4.40.0020.02010.93
4.4.30.0050.01210.93
4.4.20.0020.01810.93
4.4.10.0030.01410.93
4.4.00.0010.03010.93
4.3.110.0000.01410.93
4.3.100.0050.01610.93
4.3.90.0000.02210.93
4.3.80.0040.02510.93
4.3.70.0030.01810.93
4.3.60.0050.01710.93
4.3.50.0000.01010.93
4.3.40.0030.02410.93
4.3.30.0040.01210.93
4.3.20.0000.02210.93
4.3.10.0030.01710.93
4.3.00.0000.01210.93

preferences:
60.02 ms | 401 KiB | 5 Q