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($data); 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.0140.00416.63
8.3.60.0040.01518.30
8.3.50.0150.00521.28
8.3.40.0110.00418.93
8.3.30.0120.00319.01
8.3.20.0040.00420.35
8.3.10.0050.00323.53
8.3.00.0050.00319.68
8.2.190.0090.00916.88
8.2.180.0110.00425.92
8.2.170.0110.00718.95
8.2.160.0110.00722.96
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00421.11
8.2.110.0050.00520.64
8.2.100.0140.00017.91
8.2.90.0030.00618.03
8.2.80.0000.00820.41
8.2.70.0040.00417.63
8.2.60.0060.00318.16
8.2.50.0050.00318.07
8.2.40.0030.00520.07
8.2.30.0080.00018.09
8.2.20.0060.00317.78
8.2.10.0060.00318.14
8.2.00.0070.00018.14
8.1.280.0000.01425.92
8.1.270.0050.00320.21
8.1.260.0070.00426.35
8.1.250.0000.00928.09
8.1.240.0000.00923.92
8.1.230.0080.00420.88
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0050.00517.25
8.1.190.0000.00917.13
8.1.180.0060.00318.10
8.1.170.0080.00318.24
8.1.160.0040.00422.00
8.1.150.0000.00718.65
8.1.140.0070.00017.39
8.1.130.0070.00017.81
8.1.120.0000.00817.50
8.1.110.0060.00317.50
8.1.100.0040.00417.48
8.1.90.0000.00717.38
8.1.80.0050.00317.45
8.1.70.0080.00017.50
8.1.60.0060.00317.61
8.1.50.0050.00317.43
8.1.40.0040.00417.50
8.1.30.0040.00417.63
8.1.20.0040.00417.59
8.1.10.0000.00817.57
8.1.00.0050.00217.52
8.0.300.0030.00420.18
8.0.290.0070.00016.75
8.0.280.0070.00018.52
8.0.270.0070.00017.39
8.0.260.0030.00617.29
8.0.250.0040.00417.07
8.0.240.0070.00017.07
8.0.230.0000.00717.00
8.0.220.0000.00716.97
8.0.210.0040.00416.98
8.0.200.0060.00016.91
8.0.190.0040.00417.02
8.0.180.0080.00017.02
8.0.170.0000.00817.01
8.0.160.0020.00516.96
8.0.150.0040.00416.88
8.0.140.0050.00216.83
8.0.130.0040.00413.45
8.0.120.0060.00316.83
8.0.110.0040.00416.91
8.0.100.0040.00417.05
8.0.90.0040.00416.88
8.0.80.0100.01017.03
8.0.70.0000.00816.88
8.0.60.0040.00416.81
8.0.50.0000.00816.89
8.0.30.0060.01117.15
8.0.20.0120.01017.40
8.0.10.0050.00316.89
8.0.00.0150.00416.66
7.4.330.0030.00315.03
7.4.320.0060.00016.52
7.4.300.0060.00016.48
7.4.290.0000.00716.57
7.4.280.0040.00416.52
7.4.270.0040.00316.53
7.4.260.0040.00416.44
7.4.250.0080.00016.49
7.4.240.0060.00116.59
7.4.230.0000.00816.34
7.4.220.0090.01016.60
7.4.210.0110.00716.59
7.4.200.0070.00016.53
7.4.160.0030.01016.55
7.4.150.0030.01517.40
7.4.140.0110.01117.86
7.4.130.0100.00816.52
7.4.120.0100.00916.68
7.4.110.0130.00316.65
7.4.100.0140.01316.71
7.4.90.0120.00616.52
7.4.80.0130.00319.39
7.4.70.0100.01016.59
7.4.60.0100.00716.68
7.4.50.0030.00616.58
7.4.40.0000.01716.60
7.4.30.0240.00016.70
7.4.00.0030.01414.91
7.3.330.0070.00013.35
7.3.320.0030.00313.47
7.3.310.0070.00016.35
7.3.300.0030.00316.53
7.3.290.0050.00916.48
7.3.280.0060.01016.54
7.3.270.0140.00417.40
7.3.260.0150.00316.41
7.3.250.0110.00916.57
7.3.240.0130.01016.49
7.3.230.0110.00616.45
7.3.210.0090.00916.73
7.3.200.0060.00916.79
7.3.190.0000.01516.67
7.3.180.0180.00316.47
7.3.170.0140.00616.49
7.3.160.0090.00616.75
7.3.90.0080.00714.86
7.3.80.0040.01514.88
7.3.70.0100.00614.97
7.3.60.0080.00814.77
7.3.50.0070.01014.81
7.3.40.0060.01114.86
7.3.30.0070.00914.84
7.3.20.0070.00915.65
7.3.10.0100.00715.71
7.3.00.0190.00815.58
7.2.330.0300.01616.91
7.2.320.0060.01316.48
7.2.310.0110.01116.95
7.2.300.0070.01016.78
7.2.290.0060.01616.67
7.2.220.0080.01015.13
7.2.210.0070.01314.97
7.2.200.0120.00814.94
7.2.190.0100.00914.95
7.2.180.0120.00615.12
7.2.170.0110.00815.07
7.2.160.0080.01014.81
7.2.150.0090.01116.04
7.2.140.0110.01116.00
7.2.130.0170.01015.83
7.2.120.0290.01015.69
7.2.110.0140.00815.79
7.2.100.0200.00815.77
7.2.90.0170.00715.88
7.2.80.0190.01215.84
7.2.70.0170.01015.83
7.2.60.0190.00715.99
7.2.50.0180.01015.81
7.2.40.0180.01015.93
7.2.30.0190.00715.93
7.2.20.0160.01115.85
7.2.10.0200.01015.93
7.2.00.0200.01116.35
7.1.320.0130.00415.25
7.1.310.0100.00815.09
7.1.300.0070.01214.87
7.1.290.0100.00814.85
7.1.280.0080.01014.85
7.1.270.0090.00714.92
7.1.260.0080.00914.84
7.1.250.0080.00914.72
7.1.240.0170.01114.69
7.1.230.0170.00714.71
7.1.220.0180.00814.65
7.1.210.0220.00814.64
7.1.200.0200.00714.84
7.1.190.0210.00914.76
7.1.180.0360.00614.78
7.1.170.0190.00914.66
7.1.160.0220.00714.74
7.1.150.0290.00814.65
7.1.140.0200.00614.82
7.1.130.0260.00914.68
7.1.120.0250.01114.69
7.1.110.0250.01014.75
7.1.100.0200.01115.24
7.1.90.0280.00914.72
7.1.80.0250.01214.70
7.1.70.0310.01015.24
7.1.60.0250.00715.56
7.1.50.0270.00918.05
7.1.40.0200.01014.73
7.1.30.0300.00514.75
7.1.20.0310.00414.64
7.1.10.0270.00915.01
7.1.00.0210.01916.36
7.0.330.0120.00814.21
7.0.320.0210.00714.16
7.0.310.0220.00514.33
7.0.300.0190.01014.28
7.0.290.0200.00914.29
7.0.280.0220.00814.35
7.0.270.0370.00714.17
7.0.260.0330.01114.32
7.0.250.0190.00914.39
7.0.240.0240.00614.32
7.0.230.0320.00814.37
7.0.220.0260.00814.33
7.0.210.0240.00914.29
7.0.200.0250.00614.76
7.0.190.0300.00614.34
7.0.180.0230.00714.25
7.0.170.0230.00914.38
7.0.160.0250.01014.39
7.0.150.0220.01014.72
7.0.140.0220.01014.64
7.0.130.0250.01014.42
7.0.120.0350.00714.39
7.0.110.0250.01014.32
7.0.100.0230.00914.33
7.0.90.0320.01114.40
7.0.80.0240.00814.24
7.0.70.0190.01014.34
7.0.60.0190.02315.57
7.0.50.0340.01715.00
7.0.40.0190.02215.31
7.0.30.0290.01515.35
7.0.20.0260.01415.68
7.0.10.0270.01115.64
7.0.00.0210.01915.62
5.6.400.0110.01114.29
5.6.390.0170.00614.38
5.6.380.0120.01014.51
5.6.370.0140.00814.50
5.6.360.0160.00714.43
5.6.350.0140.00914.51
5.6.340.0130.01014.58
5.6.330.0110.01014.56
5.6.320.0120.01014.21
5.6.310.0120.01014.33
5.6.300.0150.01214.57
5.6.290.0160.00714.47
5.6.280.0110.02315.62
5.6.270.0160.00714.44
5.6.260.0170.00714.45
5.6.250.0190.00614.52
5.6.240.0110.01314.52
5.6.230.0160.01014.48
5.6.220.0150.00914.48
5.6.210.0120.02015.44
5.6.200.0140.02415.10
5.6.190.0150.01415.52
5.6.180.0190.01915.45
5.6.170.0160.01415.46
5.6.160.0090.01715.33
5.6.150.0160.01715.09
5.6.140.0130.01415.11
5.6.130.0140.01314.98
5.6.120.0180.01715.62
5.6.110.0130.01815.57
5.6.100.0120.01815.53
5.6.90.0150.01915.48
5.6.80.0140.01615.35
5.6.70.0160.00914.44
5.6.60.0120.00914.54
5.6.50.0140.00814.41
5.6.40.0150.01014.44
5.6.30.0130.00914.36
5.6.20.0110.01214.35
5.6.10.0130.01014.32
5.6.00.0130.00914.38
5.5.380.0150.00513.73
5.5.370.0170.00513.76
5.5.360.0120.01013.77
5.5.350.0160.01914.80
5.5.340.0130.01514.53
5.5.330.0140.01514.80
5.5.320.0170.01314.86
5.5.310.0160.02014.83
5.5.300.0130.01714.66
5.5.290.0140.01214.48
5.5.280.0100.01614.92
5.5.270.0140.02014.99
5.5.260.0140.01915.03
5.5.250.0110.02014.94
5.5.240.0100.02214.78
5.5.230.0100.00913.74
5.5.220.0090.01213.76
5.5.210.0120.00913.70
5.5.200.0150.00713.68
5.5.190.0110.01013.76
5.5.180.0110.01013.84
5.5.170.0140.00913.78
5.5.160.0140.00713.78
5.5.150.0150.00813.73
5.5.140.0130.00813.94
5.5.130.0120.01013.80
5.5.120.0120.01013.72
5.5.110.0090.01013.68
5.5.100.0130.00913.74
5.5.90.0160.01213.70
5.5.80.0170.00813.72
5.5.70.0140.00913.71
5.5.60.0110.01013.69
5.5.50.0160.00813.80
5.5.40.0140.00913.66
5.5.30.0140.00813.63
5.5.20.0120.00913.59
5.5.10.0130.00913.73
5.5.00.0140.00913.69
5.4.450.0180.01612.80
5.4.440.0200.01512.74
5.4.430.0100.01412.82
5.4.420.0100.01512.70
5.4.410.0100.01812.69
5.4.400.0110.01512.53
5.4.390.0090.01612.56
5.4.380.0110.01312.66
5.4.370.0110.01612.69
5.4.360.0110.01412.64
5.4.350.0120.01412.68
5.4.340.0100.01512.65
5.4.330.0110.00511.40
5.4.320.0090.01412.54
5.4.310.0120.01412.68
5.4.300.0090.01512.56
5.4.290.0100.01512.61
5.4.280.0080.01712.58
5.4.270.0100.01412.61
5.4.260.0120.01312.65
5.4.250.0160.01612.60
5.4.240.0120.01212.59
5.4.230.0130.01212.51
5.4.220.0120.01412.59
5.4.210.0110.01412.61
5.4.200.0120.01312.17
5.4.190.0140.01212.47
5.4.180.0100.02012.57
5.4.170.0120.01612.48
5.4.160.0080.01812.68
5.4.150.0110.01512.55
5.4.140.0130.01312.11
5.4.130.0100.01412.23
5.4.120.0130.01612.25
5.4.110.0090.01512.19
5.4.100.0110.01412.22
5.4.90.0150.01212.23
5.4.80.0110.01412.27
5.4.70.0090.01512.22
5.4.60.0110.01612.17
5.4.50.0110.01412.19
5.4.40.0080.01712.18
5.4.30.0090.01612.24
5.4.20.0140.01212.22
5.4.10.0130.01612.27
5.4.00.0090.01512.17

preferences:
19.11 ms | 401 KiB | 5 Q