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 { protected $moredata; public function __construct() { return parent::__construct(); } public function getExtraData(){ $this->extradata = array( 'datachild1','datachild2' ); } public function getMoreData(){ $this->moredata= array( 'more_data1','more_data2' ); } public function serialize() { return serialize(array( $this->getData(), $this->extradata, $this->moredata, )); } public function unserialize($data) { $orgdata = unserialize($data); $this->setData($orgdata[0]); $this->extradata = $orgdata[1]; $this->moredata = $orgdata[2]; } } $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.0070.01118.68
8.3.50.0130.01021.31
8.3.40.0060.00919.02
8.3.30.0090.00619.09
8.3.20.0050.00320.12
8.3.10.0060.00320.61
8.3.00.0030.00619.51
8.2.180.0060.00916.63
8.2.170.0180.00022.96
8.2.160.0100.00720.35
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00422.24
8.2.110.0080.00320.47
8.2.100.0060.00618.16
8.2.90.0090.00019.12
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0040.00417.93
8.2.50.0080.00018.07
8.2.40.0000.00918.16
8.2.30.0040.00419.21
8.2.20.0080.00017.83
8.2.10.0050.00318.08
8.2.00.0040.00417.77
8.1.280.0120.00925.92
8.1.270.0090.00023.96
8.1.260.0070.00026.35
8.1.250.0030.00528.09
8.1.240.0060.00322.05
8.1.230.0040.00719.23
8.1.220.0090.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00617.11
8.1.190.0050.00317.25
8.1.180.0030.00618.10
8.1.170.0100.00018.64
8.1.160.0000.00721.98
8.1.150.0000.00819.00
8.1.140.0050.00217.39
8.1.130.0000.00717.70
8.1.120.0030.00517.41
8.1.110.0040.00417.38
8.1.100.0020.00517.48
8.1.90.0030.00617.49
8.1.80.0040.00417.52
8.1.70.0040.00417.50
8.1.60.0060.00317.66
8.1.50.0030.00517.61
8.1.40.0040.00417.44
8.1.30.0030.00517.71
8.1.20.0000.00717.55
8.1.10.0040.00417.48
8.1.00.0030.00517.56
8.0.300.0050.00218.77
8.0.290.0060.00316.75
8.0.280.0000.00718.38
8.0.270.0080.00017.30
8.0.260.0070.00017.27
8.0.250.0000.00816.95
8.0.240.0000.00717.04
8.0.230.0030.00316.97
8.0.220.0040.00416.89
8.0.210.0000.00716.92
8.0.200.0030.00617.05
8.0.190.0000.00716.89
8.0.180.0000.00716.91
8.0.170.0000.00717.02
8.0.160.0000.00716.93
8.0.150.0040.00416.93
8.0.140.0000.00816.92
8.0.130.0000.00613.38
8.0.120.0060.00316.86
8.0.110.0000.00716.87
8.0.100.0000.00716.84
8.0.90.0040.00416.89
8.0.80.0030.01317.03
8.0.70.0040.00417.09
8.0.60.0050.00317.03
8.0.50.0050.00317.01
8.0.30.0100.00917.02
8.0.20.0130.00817.40
8.0.10.0070.00016.94
8.0.00.0060.01216.76
7.4.330.0000.00515.11
7.4.320.0030.00316.53
7.4.300.0030.00316.64
7.4.290.0030.00316.54
7.4.280.0030.00516.45
7.4.270.0000.00716.65
7.4.260.0050.00216.41
7.4.250.0080.00016.58
7.4.240.0030.00516.59
7.4.230.0000.00716.74
7.4.220.0100.01316.65
7.4.210.0040.01016.64
7.4.200.0000.00716.73
7.4.160.0060.01616.41
7.4.150.0060.01217.40
7.4.140.0050.01517.86
7.4.130.0080.01216.57
7.4.120.0130.00516.65
7.4.110.0120.00616.46
7.4.100.0090.00916.53
7.4.90.0060.01316.63
7.4.80.0100.00718.80
7.4.70.0090.00916.59
7.4.60.0030.01316.46
7.4.50.0050.00316.59
7.4.40.0120.00616.57
7.4.30.0130.00916.85
7.4.10.0040.01414.89
7.4.00.0050.00814.91
7.3.330.0050.00013.38
7.3.320.0030.00313.41
7.3.310.0030.00316.42
7.3.300.0040.00416.27
7.3.290.0130.00416.36
7.3.280.0100.00716.39
7.3.270.0030.01617.40
7.3.260.0090.00916.38
7.3.250.0120.00916.48
7.3.240.0110.00816.64
7.3.230.0000.01716.63
7.3.210.0100.00816.53
7.3.200.0190.00019.39
7.3.190.0090.00916.63
7.3.180.0090.00916.23
7.3.170.0100.00616.49
7.3.160.0090.00916.41
7.3.130.0060.01314.71
7.3.120.0110.00714.64
7.3.110.0040.00814.90
7.3.100.0070.00714.54
7.3.90.0070.01015.12
7.3.80.0000.00814.94
7.3.70.0070.01114.84
7.3.60.0030.01015.04
7.3.50.0080.00314.94
7.3.40.0030.01314.75
7.3.30.0150.00014.98
7.3.20.0090.00916.48
7.3.10.0060.00916.55
7.3.00.0100.00416.59
7.2.330.0200.00016.78
7.2.320.0070.01016.77
7.2.310.0100.00716.41
7.2.300.0100.00716.74
7.2.290.0140.00916.89
7.2.260.0190.00015.10
7.2.250.0100.00715.38
7.2.240.0070.00715.31
7.2.230.0060.01014.80
7.2.220.0030.01315.07
7.2.210.0080.00314.96
7.2.200.0110.00315.05
7.2.190.0070.01115.11
7.2.180.0000.01515.18
7.2.170.0060.01114.87
7.2.160.0110.00415.02
7.2.150.0030.01616.82
7.2.140.0040.01417.02
7.2.130.0070.00816.79
7.2.120.0070.00716.87
7.2.110.0060.00816.75
7.2.100.0100.00416.78
7.2.90.0060.00616.67
7.2.80.0060.00916.74
7.2.70.0050.01316.91
7.2.60.0080.00716.87
7.2.50.0080.00816.80
7.2.40.0080.00616.97
7.2.30.0080.00616.90
7.2.20.0050.01116.75
7.2.10.0060.00716.84
7.2.00.0070.00617.49
7.1.330.0040.01115.83
7.1.320.0070.00416.00
7.1.310.0030.01015.76
7.1.300.0120.00615.84
7.1.290.0070.01015.96
7.1.280.0060.01215.91
7.1.270.0060.01215.47
7.1.260.0030.01015.80
7.1.250.0040.01215.54
7.1.240.0120.00315.82
7.1.230.0060.00915.72
7.1.220.0070.00715.93
7.1.210.0090.00015.80
7.1.200.0000.01215.72
7.1.190.0040.00715.69
7.1.180.0030.01415.83
7.1.170.0040.00815.95
7.1.160.0040.00816.01
7.1.150.0040.00415.94
7.1.140.0090.00015.86
7.1.130.0090.00315.87
7.1.120.0030.00915.79
7.1.110.0060.00915.75
7.1.100.0040.00816.87
7.1.90.0090.00315.87
7.1.80.0040.01115.91
7.1.70.0030.00816.59
7.1.60.0050.01317.49
7.1.50.0070.00816.34
7.1.40.0000.00915.87
7.1.30.0060.00915.63
7.1.20.0040.00715.96
7.1.10.0060.00315.75
7.1.00.0020.04419.04
7.0.330.0040.00415.29
7.0.320.0040.00715.46
7.0.310.0060.00915.41
7.0.300.0000.01015.42
7.0.290.0030.01015.48
7.0.280.0030.01015.37
7.0.270.0070.00715.24
7.0.260.0070.00715.49
7.0.250.0070.01015.44
7.0.240.0030.01015.38
7.0.230.0070.00715.21
7.0.220.0070.00315.20
7.0.210.0100.00315.25
7.0.200.0020.00616.06
7.0.190.0000.01115.50
7.0.180.0060.00815.43
7.0.170.0070.00715.34
7.0.160.0060.00615.57
7.0.150.0080.00415.51
7.0.140.0070.03918.73
7.0.130.0040.01115.40
7.0.120.0070.00315.50
7.0.110.0060.00315.10
7.0.100.0090.00615.54
7.0.90.0030.01215.45
7.0.80.0030.00615.50
7.0.70.0030.00615.49
7.0.60.0050.02617.78
7.0.50.0020.05016.61
7.0.40.0060.03116.87
7.0.30.0170.04516.86
7.0.20.0140.02016.80
7.0.10.0040.03016.84
7.0.00.0140.04116.83
5.6.400.0030.01014.68
5.6.390.0070.01014.39
5.6.380.0080.00814.66
5.6.370.0060.00914.66
5.6.360.0040.01114.77
5.6.350.0040.01214.68
5.6.340.0000.01714.24
5.6.330.0030.00614.36
5.6.320.0080.00414.52
5.6.310.0030.00914.42
5.6.300.0030.00914.41
5.6.290.0110.00714.47
5.6.280.0110.03117.81
5.6.270.0000.01314.31
5.6.260.0000.01214.41
5.6.250.0040.00814.59
5.6.240.0080.00414.60
5.6.230.0000.00914.79
5.6.220.0040.00714.59
5.6.210.0030.04717.49
5.6.200.0020.02816.27
5.6.190.0060.04717.61
5.6.180.1800.02317.39
5.6.170.0170.04417.52
5.6.160.0070.03517.51
5.6.150.0100.01816.25
5.6.140.0060.02316.31
5.6.130.0050.02916.34
5.6.120.0130.04517.71
5.6.110.0030.02517.90
5.6.100.0050.02817.77
5.6.90.0070.04617.75
5.6.80.0040.04417.44
5.6.70.2050.02317.30
5.6.60.0040.01514.29
5.6.50.0070.01014.37
5.6.40.0040.00814.28
5.6.30.0000.01514.45
5.6.20.0060.00914.24
5.6.10.0040.01114.34
5.6.00.0030.01214.18
5.5.380.0000.01414.31
5.5.370.0000.01114.37
5.5.360.0070.00714.53
5.5.350.0140.04117.48
5.5.340.0120.03516.12
5.5.330.0060.02217.33
5.5.320.1570.02217.37
5.5.310.0200.04217.34
5.5.300.0070.04516.14
5.5.290.0030.04816.13
5.5.280.0130.04017.76
5.5.270.0030.04817.66
5.5.260.0070.03917.58
5.5.250.0030.03617.59
5.5.240.0130.04417.32
5.5.230.0100.00614.23
5.5.220.0100.01014.28
5.5.210.0060.01014.02
5.5.200.0040.01014.27
5.5.190.0030.01014.29
5.5.180.0070.00714.25
5.5.170.0100.00314.19
5.5.160.0000.01314.22
5.5.150.0000.01214.05
5.5.140.0090.00614.33
5.5.130.0070.01013.87
5.5.120.0060.00914.36
5.5.110.0000.00914.38
5.5.100.0090.00614.34
5.5.90.0060.00814.40
5.5.80.0060.00614.57
5.5.70.0030.01014.39
5.5.60.0090.00314.27
5.5.50.0090.00614.39
5.5.40.0040.01114.22
5.5.30.0040.01114.43
5.5.20.0110.00414.43
5.5.10.0040.01113.91
5.5.00.0090.00814.04
5.4.450.0320.02615.42
5.4.440.0450.02715.26
5.4.430.0580.03115.21
5.4.420.0570.03015.29
5.4.410.0390.03215.24
5.4.400.0400.02315.13
5.4.390.0050.03315.18
5.4.380.0130.04414.89
5.4.370.0200.02714.89
5.4.360.0130.03214.93
5.4.350.0220.02814.93
5.4.340.0250.04314.79
5.4.330.0000.00911.11
5.4.320.0060.02211.91
5.4.310.0040.02411.73
5.4.300.0060.02111.87
5.4.290.0060.02311.84
5.4.280.0060.02511.75
5.4.270.0070.02111.84
5.4.260.0070.02211.57
5.4.250.0050.02411.74
5.4.240.0090.01711.80
5.4.230.0040.02511.81
5.4.220.0070.02011.70
5.4.210.0020.02411.79
5.4.200.0050.03211.74
5.4.190.0040.02611.64
5.4.180.0060.02111.79
5.4.170.0040.02311.80
5.4.160.0040.02311.83
5.4.150.0090.02011.70
5.4.140.0050.02011.67
5.4.130.0060.02011.74
5.4.120.0070.02011.58
5.4.110.0070.01711.57
5.4.100.0020.02611.50
5.4.90.0070.02411.68
5.4.80.0040.02711.50
5.4.70.0040.02611.59
5.4.60.0060.02411.40
5.4.50.0030.02211.61
5.4.40.0070.01911.61
5.4.30.0060.02211.61
5.4.20.0040.02211.61
5.4.10.0050.02011.64
5.4.00.0050.02511.35
5.3.290.0070.04212.80
5.3.280.0080.03512.71
5.3.270.0040.04412.72
5.3.260.0090.03512.72
5.3.250.0130.03312.72
5.3.240.0080.03612.72
5.3.230.0030.03912.71
5.3.220.0070.03512.68
5.3.210.0060.03912.68
5.3.200.0080.04712.68
5.3.190.0070.03712.68
5.3.180.0050.03712.68
5.3.170.0060.03712.67
5.3.160.0060.03812.67
5.3.150.0080.05012.67
5.3.140.0090.05112.66
5.3.130.0080.04112.66
5.3.120.0070.03912.66
5.3.110.0070.03812.66
5.3.100.0050.03912.15
5.3.90.0080.03512.13
5.3.80.0040.03812.12
5.3.70.0050.04312.12
5.3.60.0080.03512.11
5.3.50.0070.03612.05
5.3.40.0050.03812.05
5.3.30.0070.03412.01
5.3.20.0060.04311.79
5.3.10.0050.03711.75
5.3.00.0030.04211.75
5.2.170.0050.0359.25
5.2.160.0060.0289.25
5.2.150.0030.0329.25
5.2.140.0050.0349.25
5.2.130.0050.0289.21
5.2.120.0060.0309.21
5.2.110.0050.0319.21
5.2.100.0040.0309.21
5.2.90.0030.0319.21
5.2.80.0050.0339.21
5.2.70.0070.0369.21
5.2.60.0060.0349.16
5.2.50.0030.0349.13
5.2.40.0040.0299.11
5.2.30.0090.0339.08
5.2.20.0020.0319.07
5.2.10.0050.0278.97
5.2.00.0060.0278.84
5.1.60.0070.0218.13
5.1.50.0020.0288.12
5.1.40.0030.0268.10
5.1.30.0020.0328.45
5.1.20.0050.0358.48
5.1.10.0020.0288.20
5.1.00.0020.0288.20
5.0.50.0040.0206.66
5.0.40.0030.0206.53
5.0.30.0040.0366.35
5.0.20.0020.0206.31
5.0.10.0040.0196.29
5.0.00.0040.0346.28
4.4.90.0040.0194.78
4.4.80.0010.0164.75
4.4.70.0010.0164.75
4.4.60.0030.0144.75
4.4.50.0030.0154.77
4.4.40.0050.0244.71
4.4.30.0030.0144.75
4.4.20.0020.0224.84
4.4.10.0030.0194.85
4.4.00.0010.0254.76
4.3.110.0010.0174.66
4.3.100.0070.0204.67
4.3.90.0050.0224.63
4.3.80.0030.0274.58
4.3.70.0020.0154.63
4.3.60.0000.0174.63
4.3.50.0000.0184.63
4.3.40.0040.0224.54
4.3.30.0030.0143.30
4.3.20.0010.0223.28
4.3.10.0010.0173.23
4.3.00.0100.0207.58

preferences:
52.26 ms | 401 KiB | 5 Q