3v4l.org

run code in 300+ PHP versions simultaneously
<?php class parentobj implements Serializable { protected $data; private $extradata; public function __construct() { $this->data = new temp("My private data"); } public function getData() { return $this->data; } public function setData($data) { $this->data = $data; } public function getExtraData(){ $this->extradata = array( 'data1','data2' ); } public function serialize() { return serialize(array( $this->data, $this->extradata, )); } public function unserialize($data) { $orgdata = unserialize($data); $this->data = $orgdata[0]; $this->extradata = $orgdata[1]; } } class childobj extends parentobj { protected $moredata; public function __construct() { return parent::__construct(); } public function getMoreData(){ $this->moredata= array( 'more_data1','more_data2' ); } public function serialize() { return serialize(array( $this->data, $this->moredata, parent::serialize(), )); } public function unserialize($data) { $orgdata = unserialize($data); $this->setData($orgdata[0]); $this->extradata = $orgdata[1]; $this->moredata = $orgdata[2]; parent::unserialize($orgdata[3]); } } class temp { protected $name; public function __construct($Name) { $this->name = $Name; } } $obj = new childobj(); $s = serialize($obj); echo 'first serialize: '; var_dump($s); $u = unserialize($s); echo 'first unserialize: '; var_dump($u); $u->getExtraData(); $u->getMoreData(); echo 'with extradata: '; var_dump($u); $s2 = serialize($u); echo 'second serialize: '; var_dump($s2); $u2 = unserialize($s2); echo 'second unserialize: '; var_dump($u2);

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.0100.01018.43
8.3.50.0120.00722.16
8.3.40.0080.00818.96
8.3.30.0140.00719.04
8.3.20.0080.00020.39
8.3.10.0080.00020.65
8.3.00.0040.00419.51
8.2.180.0060.00916.48
8.2.170.0070.00722.96
8.2.160.0100.00720.58
8.2.150.0000.00924.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0040.00422.21
8.2.110.0050.00520.51
8.2.100.0090.00317.91
8.2.90.0000.00819.22
8.2.80.0000.00817.97
8.2.70.0060.00317.38
8.2.60.0030.00518.16
8.2.50.0000.00918.07
8.2.40.0000.00818.21
8.2.30.0040.00419.21
8.2.20.0050.00317.89
8.2.10.0060.00518.14
8.2.00.0050.00317.86
8.1.280.0110.00425.92
8.1.270.0080.00023.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0110.00019.01
8.1.220.0000.00817.77
8.1.210.0000.00818.77
8.1.200.0070.00317.35
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0100.00318.61
8.1.160.0040.00422.12
8.1.150.0080.00018.91
8.1.140.0040.00417.39
8.1.130.0030.00317.81
8.1.120.0000.00717.41
8.1.110.0000.00717.47
8.1.100.0070.00017.45
8.1.90.0110.00017.52
8.1.80.0000.00917.47
8.1.70.0000.00717.46
8.1.60.0060.00317.66
8.1.50.0000.00817.54
8.1.40.0030.00517.59
8.1.30.0030.00617.63
8.1.20.0000.00717.66
8.1.10.0050.00317.62
8.1.00.0080.00017.58
8.0.300.0000.00918.77
8.0.290.0030.00616.75
8.0.280.0050.00518.47
8.0.270.0000.00717.29
8.0.260.0000.00717.20
8.0.250.0030.00317.04
8.0.240.0000.00716.91
8.0.230.0000.00717.04
8.0.220.0000.00716.96
8.0.210.0040.00417.00
8.0.200.0000.00817.01
8.0.190.0060.00316.96
8.0.180.0030.00517.01
8.0.170.0030.00516.87
8.0.160.0040.00416.97
8.0.150.0050.00216.84
8.0.140.0040.00416.95
8.0.130.0000.00613.45
8.0.120.0040.00416.88
8.0.110.0080.00017.01
8.0.100.0000.00716.94
8.0.90.0000.00816.85
8.0.80.0060.00916.93
8.0.70.0040.00416.85
8.0.60.0000.00716.87
8.0.50.0040.00416.95
8.0.30.0100.01117.21
8.0.20.0150.00817.40
8.0.10.0070.00016.89
8.0.00.0110.00716.76
7.4.330.0000.00515.02
7.4.320.0000.00616.66
7.4.300.0030.00316.54
7.4.290.0040.00416.62
7.4.280.0020.00516.54
7.4.270.0050.00216.55
7.4.260.0030.00316.38
7.4.250.0000.00816.57
7.4.240.0050.00216.58
7.4.230.0040.00416.61
7.4.220.0130.01016.74
7.4.210.0040.01016.62
7.4.200.0030.00316.70
7.4.160.0120.00616.77
7.4.150.0120.00917.40
7.4.140.0050.01417.86
7.4.130.0110.00816.65
7.4.120.0130.00816.63
7.4.110.0100.01016.50
7.4.100.0110.01116.70
7.4.90.0140.00516.56
7.4.80.0090.01518.80
7.4.70.0150.00316.52
7.4.60.0100.00716.55
7.4.50.0060.00316.75
7.4.40.0090.00916.50
7.4.30.0090.00916.59
7.4.00.0070.01215.09
7.3.330.0030.00313.47
7.3.320.0030.00313.35
7.3.310.0000.00716.34
7.3.300.0000.00716.51
7.3.290.0030.01116.52
7.3.280.0080.01116.39
7.3.270.0060.01217.40
7.3.260.0080.01116.46
7.3.250.0070.01216.54
7.3.240.0110.00716.44
7.3.230.0090.00916.56
7.3.210.0120.00616.42
7.3.200.0130.00619.39
7.3.190.0090.00916.50
7.3.180.0130.01016.41
7.3.170.0100.00716.51
7.3.160.0060.01016.48
7.3.120.0120.00614.84
7.3.110.0100.00614.79
7.3.100.0080.00614.84
7.3.90.0090.00615.03
7.3.80.0060.00914.95
7.3.70.0090.00314.93
7.3.60.0000.01014.75
7.3.50.0060.01314.96
7.3.40.0000.01414.67
7.3.30.0000.01214.70
7.3.20.0070.01116.54
7.3.10.0120.00316.84
7.3.00.0060.00616.57
7.2.330.0110.00816.94
7.2.320.0080.01116.81
7.2.310.0180.00016.73
7.2.300.0100.01016.83
7.2.290.0030.01516.97
7.2.250.0060.01214.85
7.2.240.0110.00415.21
7.2.230.0030.01415.29
7.2.220.0090.00915.06
7.2.210.0000.01515.09
7.2.200.0070.00715.23
7.2.190.0070.00715.18
7.2.180.0000.01514.80
7.2.170.0070.01015.18
7.2.130.0000.01316.25
7.2.120.0100.00017.07
7.2.110.0110.00716.94
7.2.100.0130.00616.98
7.2.90.0120.01216.94
7.2.80.0070.01417.16
7.2.70.0120.00616.91
7.2.60.0050.01116.89
7.2.50.0040.00717.13
7.2.40.0070.01016.98
7.2.30.0090.00616.88
7.2.20.0120.00416.99
7.2.10.0170.01116.73
7.2.00.0110.00818.10
7.1.330.0100.00715.86
7.1.320.0030.00915.71
7.1.310.0080.01115.47
7.1.300.0100.00315.51
7.1.290.0030.01015.85
7.1.280.0030.00915.84
7.1.270.0030.01015.55
7.1.260.0070.00715.66
7.1.250.0030.01015.45
7.1.240.0060.00615.79
7.1.230.0100.01015.60
7.1.220.0170.00715.51
7.1.210.0120.00815.68
7.1.200.0090.00715.81
7.1.190.0060.00615.79
7.1.180.0030.00615.84
7.1.170.0170.00715.80
7.1.160.0030.01015.71
7.1.150.0120.01215.75
7.1.140.0080.00615.38
7.1.130.0100.00815.66
7.1.120.0060.00915.64
7.1.110.0110.00615.63
7.1.100.0080.00616.85
7.1.90.0110.00315.40
7.1.80.0070.01015.87
7.1.70.0100.01216.38
7.1.60.0030.01617.52
7.1.50.0060.00816.05
7.1.40.0120.00315.82
7.1.30.0030.00715.70
7.1.20.0130.00315.70
7.1.10.0090.00915.97
7.1.00.0070.04219.14
7.0.330.0070.00615.30
7.0.320.0190.00815.21
7.0.310.0060.00915.30
7.0.300.0070.00715.04
7.0.290.0100.00315.46
7.0.280.0080.00815.42
7.0.270.0160.01315.41
7.0.260.0140.00315.46
7.0.250.0080.00815.39
7.0.240.0200.00315.39
7.0.230.0100.00715.59
7.0.220.0050.00815.39
7.0.210.0060.00615.52
7.0.200.0040.00715.93
7.0.190.0060.00315.37
7.0.180.0060.00915.33
7.0.170.0070.00415.48
7.0.160.0060.00615.46
7.0.150.0040.00915.11
7.0.140.0040.04418.61
7.0.130.0080.00415.37
7.0.120.0110.00415.30
7.0.110.0080.00515.29
7.0.100.0070.01015.40
7.0.90.0130.00615.33
7.0.80.0130.00315.32
7.0.70.0230.00015.62
7.0.60.0070.03617.63
7.0.50.0050.02916.61
7.0.40.0100.03516.75
7.0.30.0150.04016.65
7.0.20.0200.04016.78
7.0.10.0100.04816.62
7.0.00.0150.02816.74
5.6.380.0000.01714.79
5.6.370.0080.00014.27
5.6.360.0000.01114.50
5.6.350.0130.00314.46
5.6.340.0180.00414.31
5.6.330.0070.01014.20
5.6.320.0110.00714.31
5.6.310.0000.01714.27
5.6.300.0060.00914.22
5.6.290.0080.01214.47
5.6.280.0080.04117.86
5.6.270.0090.00314.40
5.6.260.0100.00714.18
5.6.250.0090.00614.25
5.6.240.0070.00714.61
5.6.230.0070.00714.01
5.6.220.0120.00614.33
5.6.210.0080.04517.65
5.6.200.0050.02316.24
5.6.190.0050.04317.45
5.6.180.0220.03917.26
5.6.170.0170.04517.22
5.6.160.0080.03517.41
5.6.150.0120.03216.33
5.6.140.0090.02516.29
5.6.130.0110.04716.11
5.6.120.0110.02817.68
5.6.110.0100.04417.63
5.6.100.0030.04917.75
5.6.90.0060.02317.61
5.6.80.0030.02517.28
5.6.70.1800.01917.39
5.6.60.0060.00314.05
5.6.50.0250.00314.15
5.6.40.0080.00613.99
5.6.30.0000.01114.33
5.6.20.0140.01014.38
5.6.10.0190.01214.10
5.6.00.0160.00713.98
5.5.380.0000.01011.29
5.5.370.0120.00011.16
5.5.360.0070.00710.95
5.5.350.0120.04215.83
5.5.340.0060.02114.45
5.5.330.0030.04515.82
5.5.320.0120.04015.85
5.5.310.0120.03615.81
5.5.300.0110.04414.60
5.5.290.0090.04414.66
5.5.280.0090.04315.95
5.5.270.0100.03716.04
5.5.260.0070.03315.94
5.5.250.0080.02315.77
5.5.240.0070.04015.62
5.5.230.0060.00310.85
5.5.220.0070.00311.02
5.5.210.0060.00311.13
5.5.200.0150.00911.34
5.5.190.0030.00910.82
5.5.180.0040.01210.91
5.5.170.0080.00611.05
5.5.160.0140.00311.13
5.5.150.0150.00410.66
5.5.140.0130.00311.14
5.5.130.0050.00511.20
5.5.120.0090.00310.93
5.5.110.0060.00910.87
5.5.100.0170.01010.95
5.5.90.0130.00411.27
5.5.80.0070.00710.70
5.5.70.0220.00611.08
5.5.60.0070.00710.82
5.5.50.0120.00010.94
5.5.40.0080.00311.21
5.5.30.0130.01011.25
5.5.20.0060.00611.02
5.5.10.0180.00310.75
5.5.00.0120.00811.22
5.4.450.0020.02415.15
5.4.440.0030.03515.16
5.4.430.0110.03315.27
5.4.420.0370.00215.26
5.4.410.0340.00415.27
5.4.400.0320.00614.92
5.4.390.0330.00415.15
5.4.380.0180.02814.78
5.4.370.0460.03814.61
5.4.360.0570.03414.78
5.4.350.0520.03214.60
5.4.340.0580.02715.03
5.4.330.0120.00411.14
5.4.320.0060.02311.78
5.4.310.0090.02411.69
5.4.300.0050.02211.81
5.4.290.0030.02411.72
5.4.280.0080.02011.76
5.4.270.0100.02011.51
5.4.260.0040.02711.78
5.4.250.0070.02411.55
5.4.240.0100.02411.52
5.4.230.0080.02811.57
5.4.220.0040.02411.68
5.4.210.0100.01911.67
5.4.200.0080.02211.80
5.4.190.0150.02011.74
5.4.180.0160.01711.71
5.4.170.0090.02411.68
5.4.160.0150.01911.53
5.4.150.0110.02011.63
5.4.140.0090.02011.46
5.4.130.0080.02311.69
5.4.120.0100.01811.52
5.4.110.0110.02111.53
5.4.100.0110.02511.49
5.4.90.0110.02011.55
5.4.80.0060.02011.49
5.4.70.0090.01911.58
5.4.60.0050.02211.57
5.4.50.0090.02211.49
5.4.40.0110.02111.42
5.4.30.0070.02511.46
5.4.20.0100.02411.61
5.4.10.0060.02611.56
5.4.00.0070.02711.23
5.3.290.0140.02111.85
5.3.280.0060.03211.67
5.3.270.0100.02211.71
5.3.260.0080.02311.63
5.3.250.0090.01911.69
5.3.240.0070.02211.67
5.3.230.0090.02511.65
5.3.220.0080.02111.68
5.3.210.0080.02411.67
5.3.200.0060.02211.60
5.3.190.0050.02311.64
5.3.180.0130.02011.69
5.3.170.0100.02111.82
5.3.160.0080.02111.65
5.3.150.0080.02211.60
5.3.140.0050.02411.66
5.3.130.0150.02111.75
5.3.120.0090.02211.71
5.3.110.0080.02111.59
5.3.100.0100.02011.32
5.3.90.0050.02611.37
5.3.80.0170.01811.35
5.3.70.0080.02011.27
5.3.60.0080.01911.37
5.3.50.0040.02411.38
5.3.40.0100.01911.44
5.3.30.0080.02011.38
5.3.20.0090.02111.19
5.3.10.0080.02111.01
5.3.00.0110.02311.06
5.2.170.0060.0169.61
5.2.160.0050.0189.61
5.2.150.0100.0169.61
5.2.140.0070.0169.61
5.2.130.0080.0159.59
5.2.120.0100.0179.59
5.2.110.0030.0229.59
5.2.100.0060.0219.59
5.2.90.0070.0179.59
5.2.80.0040.0179.59
5.2.70.0050.0189.59
5.2.60.0050.0199.56
5.2.50.0070.0179.54
5.2.40.0060.0199.53
5.2.30.0030.0209.52
5.2.20.0040.0189.52
5.2.10.0060.0149.47
5.2.00.0060.0199.40
5.1.60.0020.0169.04
5.1.50.0040.0149.04
5.1.40.0020.0179.03
5.1.30.0040.0189.21
5.1.20.0020.0189.22
5.1.10.0060.0189.08
5.1.00.0050.0159.08
5.0.50.0040.0128.31
5.0.40.0050.0098.24
5.0.30.0030.0198.15
5.0.20.0010.0148.13
5.0.10.0050.0128.12
5.0.00.0060.0188.12
4.4.90.0030.0127.37
4.4.80.0040.0097.35
4.4.70.0060.0127.36
4.4.60.0020.0137.36
4.4.50.0010.0137.36
4.4.40.0040.0177.33
4.4.30.0020.0127.36
4.4.20.0020.0167.40
4.4.10.0030.0117.40
4.4.00.0020.0147.36
4.3.110.0030.0137.31
4.3.100.0020.0097.31
4.3.90.0020.0117.29
4.3.80.0020.0167.27
4.3.70.0020.0107.29
4.3.60.0020.0097.29
4.3.50.0030.0107.29
4.3.40.0020.0137.25
4.3.30.0020.0116.63
4.3.20.0010.0126.62
4.3.10.0020.0096.60
4.3.00.0050.01513.17

preferences:
40.9 ms | 401 KiB | 5 Q