3v4l.org

run code in 300+ PHP versions simultaneously
<?php class parentobj implements Serializable { private $data; protected $extradata; public function __construct() { $this->data = "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 { public function __construct() { return parent::__construct(); } public function getExtraData(){ $this->extradata = array( 'datachild1','datachild2' ); } public function serialize() { return serialize(array( $this->getData(), $this->extradata, )); } public function unserialize($data) { $orgdata = unserialize($data); $this->setData($orgdata[0]); $this->extradata = $orgdata[1]; } } $obj = new childobj(); $s = serialize($obj); echo 'first serialize: '; var_dump($s); $u = unserialize($s); echo 'first unserialize: '; var_dump($u); $u->getExtraData(); 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.0110.01118.55
8.3.50.0100.00921.99
8.3.40.0150.00018.86
8.3.30.0150.00319.22
8.3.20.0000.00820.20
8.3.10.0060.00320.40
8.3.00.0080.00019.38
8.2.180.0100.00618.41
8.2.170.0070.00722.96
8.2.160.0080.01220.57
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.13
8.2.110.0130.00622.27
8.2.100.0120.00018.03
8.2.90.0000.00819.17
8.2.80.0030.00617.97
8.2.70.0060.00317.63
8.2.60.0090.00317.68
8.2.50.0050.00318.07
8.2.40.0050.00318.20
8.2.30.0040.00419.23
8.2.20.0050.00317.67
8.2.10.0080.00018.17
8.2.00.0070.00317.77
8.1.280.0150.00325.92
8.1.270.0040.00423.71
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00323.96
8.1.230.0040.00719.15
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0030.00717.47
8.1.190.0040.00417.35
8.1.180.0000.00918.10
8.1.170.0070.00318.62
8.1.160.0030.00621.97
8.1.150.0030.00618.85
8.1.140.0040.00417.48
8.1.130.0030.00317.90
8.1.120.0030.00417.51
8.1.110.0040.00417.55
8.1.100.0000.00817.49
8.1.90.0060.00317.40
8.1.80.0030.00617.45
8.1.70.0000.00717.45
8.1.60.0050.00317.65
8.1.50.0050.00317.50
8.1.40.0060.00317.55
8.1.30.0080.00017.63
8.1.20.0030.00517.68
8.1.10.0040.00417.48
8.1.00.0040.00417.54
8.0.300.0000.00820.57
8.0.290.0040.00416.75
8.0.280.0000.00718.50
8.0.270.0000.00717.30
8.0.260.0030.00317.42
8.0.250.0000.00716.96
8.0.240.0000.00717.08
8.0.230.0000.00717.04
8.0.220.0030.00516.89
8.0.210.0080.00017.00
8.0.200.0070.00016.98
8.0.190.0000.00717.05
8.0.180.0000.00716.94
8.0.170.0040.00416.92
8.0.160.0000.00717.02
8.0.150.0070.00016.92
8.0.140.0080.00016.99
8.0.130.0000.00613.39
8.0.120.0040.00416.93
8.0.110.0050.00317.00
8.0.100.0000.00717.02
8.0.90.0000.00817.12
8.0.80.0030.01217.06
8.0.70.0080.00017.12
8.0.60.0000.00717.07
8.0.50.0020.00516.89
8.0.30.0060.01417.12
8.0.20.0110.01017.40
8.0.10.0040.00417.16
8.0.00.0130.00616.96
7.4.330.0000.00615.13
7.4.320.0050.00316.45
7.4.300.0000.00616.53
7.4.290.0030.00316.66
7.4.280.0090.00016.64
7.4.270.0040.00416.65
7.4.260.0000.00716.54
7.4.250.0040.00416.51
7.4.240.0000.00716.51
7.4.230.0040.00416.48
7.4.220.0090.00916.66
7.4.210.0070.00716.61
7.4.200.0030.00316.45
7.4.160.0060.01016.54
7.4.150.0110.00717.40
7.4.140.0060.01217.86
7.4.130.0100.01116.67
7.4.120.0100.00816.61
7.4.110.0070.01116.71
7.4.100.0150.01016.59
7.4.90.0060.01216.52
7.4.80.0150.00918.80
7.4.70.0030.01616.70
7.4.60.0040.01216.44
7.4.50.0050.00316.39
7.4.40.0100.00916.47
7.4.30.0090.00916.38
7.4.00.0060.00914.98
7.3.330.0030.00313.34
7.3.320.0000.00513.22
7.3.310.0040.00416.31
7.3.300.0020.00516.40
7.3.290.0070.00716.41
7.3.280.0080.01016.39
7.3.270.0070.01117.40
7.3.260.0090.00916.37
7.3.250.0110.00916.45
7.3.240.0070.01516.57
7.3.230.0040.01716.47
7.3.210.0100.00716.32
7.3.200.0090.00919.39
7.3.190.0100.00716.42
7.3.180.0050.01116.45
7.3.170.0100.00616.41
7.3.160.0060.00916.46
7.2.330.0130.00716.89
7.2.320.0110.00716.90
7.2.310.0120.00516.52
7.2.300.0120.01216.79
7.2.290.0040.01516.67
7.2.00.0000.01519.66
7.1.100.0080.00418.11
7.1.70.0000.00716.98
7.1.60.0070.01819.32
7.1.50.0070.01517.00
7.1.00.0100.07022.28
7.0.200.0030.00616.78
7.0.140.0070.06722.08
7.0.110.0030.05319.98
7.0.100.0130.06720.05
7.0.90.0070.08320.00
7.0.80.0070.04319.97
7.0.70.0170.04020.09
7.0.60.0030.06019.91
7.0.50.0100.05320.00
7.0.40.0030.05319.78
7.0.30.0100.06719.87
7.0.20.0130.04719.77
7.0.10.0100.04319.81
7.0.00.0070.07719.88
5.6.260.0070.04720.74
5.6.250.0030.04720.63
5.6.240.0030.03720.68
5.6.230.0100.07020.70
5.6.220.0000.09020.66
5.6.210.0070.08720.74
5.6.200.0070.06020.84
5.6.190.0070.08320.61
5.6.180.0100.04320.65
5.6.170.0130.07020.63
5.6.160.0130.07720.58
5.6.150.0200.06020.63
5.6.140.0070.09320.71
5.6.130.0170.06720.66
5.6.120.0100.08020.67
5.6.110.0070.05020.68
5.6.100.0030.09320.86
5.6.90.0000.04020.55
5.6.80.0070.04020.01
5.6.70.0100.03720.00
5.6.60.0030.04720.09
5.6.50.0030.07719.98
5.6.40.0070.08320.01
5.6.30.0100.05719.99
5.6.20.0100.06720.04
5.6.10.0100.07719.89
5.6.00.0100.06320.08
5.5.380.0100.08017.70
5.5.370.0070.06017.59
5.5.360.0000.06017.56
5.5.350.0030.08017.56
5.5.340.0030.08017.96
5.5.330.0070.07718.11
5.5.320.0030.04717.91
5.5.310.0100.08018.05
5.5.300.0030.05318.13
5.5.290.0030.05717.93
5.5.280.0070.07718.10
5.5.270.0070.06018.09
5.5.260.0070.06317.91
5.5.250.0030.04017.73
5.5.240.0030.04017.61
5.5.230.0030.04017.30
5.5.220.0130.03017.65
5.5.210.0170.07017.48
5.5.200.0130.07017.57
5.5.190.0070.06017.45
5.5.180.0030.03717.60
5.5.160.0130.05317.26
5.5.150.0070.03317.41
5.5.140.0100.03317.27
5.5.130.0100.03017.14
5.5.120.0030.04017.41
5.5.110.0030.03717.30
5.5.100.0030.04017.17
5.5.90.0000.03317.16
5.5.80.0030.04317.48
5.5.70.0070.02717.34
5.5.60.0000.03317.33
5.5.50.0030.04317.20
5.5.40.0030.03717.38
5.5.30.0100.05017.33
5.5.20.0030.04317.16
5.5.10.0030.03717.17
5.5.00.0030.03317.19
5.4.450.0030.07719.52
5.4.440.0030.06319.34
5.4.430.0030.06719.29
5.4.420.0130.07019.32
5.4.410.0030.03719.14
5.4.400.0000.04318.99
5.4.390.0000.04019.37
5.4.380.0070.03319.18
5.4.370.0030.07019.22
5.4.360.0130.07319.03
5.4.350.0100.03018.98
5.4.340.0100.05719.01
5.4.320.0030.04719.00
5.4.310.0100.06019.34
5.4.300.0000.04018.99
5.4.290.0000.04019.24
5.4.280.0070.03719.18
5.4.270.0000.04018.98
5.4.260.0000.04319.31
5.4.250.0070.03319.16
5.4.240.0070.03318.99
5.4.230.0030.03718.98
5.4.220.0000.03318.98
5.4.210.0070.03319.17
5.4.200.0000.04019.03
5.4.190.0070.03019.17
5.4.180.0030.03719.08
5.4.170.0000.04018.99
5.4.160.0070.04019.12
5.4.150.0100.03019.22
5.4.140.0000.05016.37
5.4.130.0000.04016.37
5.4.120.0000.04016.35
5.4.110.0000.04016.54
5.4.100.0000.03316.56
5.4.90.0070.03316.38
5.4.80.0030.03716.40
5.4.70.0000.03716.47
5.4.60.0070.02316.50
5.4.50.0100.03016.55
5.4.40.0070.03016.43
5.4.30.0030.03016.48
5.4.20.0000.03016.47
5.4.10.0030.03316.34
5.4.00.0000.03015.91
5.3.290.0000.04314.72
5.3.280.0000.04014.63
5.3.270.0030.03714.68
5.3.260.0030.03314.66
5.3.250.0100.03014.65
5.3.240.0000.03714.49
5.3.230.0100.02714.64
5.3.220.0030.03714.60
5.3.210.0000.04014.58
5.3.200.0030.04014.61
5.3.190.0000.03314.63
5.3.180.0030.03714.44
5.3.170.0000.03714.58
5.3.160.0000.03314.73
5.3.150.0070.03314.61
5.3.140.0000.04014.59
5.3.130.0030.03714.66
5.3.120.0000.03314.58
5.3.110.0030.03714.60
5.3.100.0000.03314.16
5.3.90.0030.03014.00
5.3.80.0030.03013.91
5.3.70.0030.03314.08
5.3.60.0070.02714.08
5.3.50.0100.02314.03
5.3.40.0000.03313.96
5.3.30.0000.03714.02
5.3.20.0070.02713.94
5.3.10.0100.05713.68
5.3.00.0030.06013.67
5.2.170.0000.03012.14
5.2.160.0030.02312.14
5.2.150.0000.02712.14
5.2.140.0070.04012.14
5.2.130.0070.02012.14
5.2.120.0100.02312.14
5.2.110.0130.02712.14
5.2.100.0070.03012.14
5.2.90.0000.03012.14
5.2.80.0070.06012.14
5.2.70.0070.05012.14
5.2.60.0000.04012.14
5.2.50.0000.05712.14
5.2.40.0030.04312.14
5.2.30.0000.03712.14
5.2.20.0100.02012.14
5.2.10.0030.03712.14
5.2.00.0070.03012.14
5.1.60.0030.05012.14
5.1.50.0100.05012.14
5.1.40.0070.05012.14
5.1.30.0030.05712.14
5.1.20.0030.03012.14
5.1.10.0030.03012.14
5.1.00.0070.05012.14
5.0.50.0030.04712.14
5.0.40.0030.03012.14
5.0.30.0030.06012.14
5.0.20.0130.03712.14
5.0.10.0030.04312.14
5.0.00.0070.03012.14
4.4.90.0030.03012.14
4.4.80.0100.03012.14
4.4.70.0030.01312.14
4.4.60.0070.02012.14
4.4.50.0130.02312.14
4.4.40.0000.03012.14
4.4.30.0030.02712.14
4.4.20.0000.02012.14
4.4.10.0030.01712.14
4.4.00.0030.05312.14
4.3.110.0070.03012.14
4.3.100.0130.01012.14
4.3.90.0000.03012.14
4.3.80.0000.05312.14
4.3.70.0030.03012.14
4.3.60.0030.02712.14
4.3.50.0030.03312.14
4.3.40.0000.03712.14
4.3.30.0070.01012.14
4.3.20.0000.02012.14
4.3.10.0000.03312.14
4.3.00.0000.02712.14

preferences:
38.87 ms | 401 KiB | 5 Q