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->moredata = $orgdata[1]; parent::unserialize($orgdata[2]); } } 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.00822.06
8.3.40.0120.00319.02
8.3.30.0090.00919.24
8.3.20.0080.00020.02
8.3.10.0030.00520.52
8.3.00.0040.00419.38
8.2.180.0090.00617.00
8.2.170.0110.00722.96
8.2.160.0070.01420.52
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00022.23
8.2.110.0040.00420.52
8.2.100.0080.00418.04
8.2.90.0040.00418.16
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0000.00818.03
8.2.50.0040.00418.07
8.2.40.0000.00818.09
8.2.30.0030.00619.34
8.2.20.0040.00417.84
8.2.10.0040.00418.25
8.2.00.0030.00517.84
8.1.280.0040.01125.92
8.1.270.0030.00523.64
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.20
8.1.230.0040.00720.82
8.1.220.0040.00417.79
8.1.210.0000.00818.96
8.1.200.0030.00617.35
8.1.190.0030.00617.35
8.1.180.0050.00318.10
8.1.170.0040.00818.60
8.1.160.0000.00721.96
8.1.150.0040.00418.90
8.1.140.0040.00417.36
8.1.130.0030.00317.92
8.1.120.0000.00717.57
8.1.110.0020.00517.50
8.1.100.0080.00017.48
8.1.90.0070.00317.39
8.1.80.0090.00217.48
8.1.70.0040.00417.42
8.1.60.0030.00617.52
8.1.50.0000.00917.45
8.1.40.0050.00217.54
8.1.30.0040.00417.61
8.1.20.0040.00417.72
8.1.10.0000.00817.65
8.1.00.0030.00617.54
8.0.300.0040.00420.09
8.0.290.0040.00416.75
8.0.280.0070.00018.40
8.0.270.0030.00317.32
8.0.260.0000.00817.28
8.0.250.0000.00716.97
8.0.240.0000.00717.04
8.0.230.0000.00717.07
8.0.220.0030.00316.84
8.0.210.0070.00016.95
8.0.200.0070.00016.98
8.0.190.0000.00717.05
8.0.180.0050.00317.05
8.0.170.0030.00516.98
8.0.160.0030.00516.95
8.0.150.0000.00716.87
8.0.140.0000.00716.84
8.0.130.0060.00013.40
8.0.120.0050.00316.84
8.0.110.0000.00816.92
8.0.100.0000.00816.93
8.0.90.0050.00317.04
8.0.80.0120.00316.86
8.0.70.0000.00716.89
8.0.60.0030.00516.87
8.0.50.0060.00316.88
8.0.30.0090.01017.25
8.0.20.0100.01417.40
8.0.10.0040.00416.98
8.0.00.0120.00916.79
7.4.330.0050.00015.04
7.4.320.0070.00016.55
7.4.300.0030.00316.64
7.4.290.0030.00316.61
7.4.280.0060.00316.67
7.4.270.0000.00716.50
7.4.260.0030.00616.62
7.4.250.0040.00416.49
7.4.240.0000.00816.61
7.4.230.0030.00316.56
7.4.220.0160.01016.73
7.4.210.0030.01216.62
7.4.200.0080.00016.71
7.4.160.0110.01116.71
7.4.150.0430.01317.40
7.4.140.0100.00817.86
7.4.130.0140.00416.54
7.4.120.0090.00816.58
7.4.110.0130.00716.50
7.4.100.0040.01816.73
7.4.90.0170.00316.52
7.4.80.0090.01218.80
7.4.70.0040.01416.54
7.4.60.0030.01316.61
7.4.50.0000.00516.68
7.4.40.0140.00316.45
7.4.30.0100.00716.52
7.4.10.0030.01415.23
7.4.00.0030.01415.04
7.3.330.0030.00313.31
7.3.320.0000.00513.43
7.3.310.0000.00816.36
7.3.300.0070.00016.46
7.3.290.0040.01116.52
7.3.280.0060.01216.49
7.3.270.0130.00717.40
7.3.260.0110.00616.45
7.3.250.0130.00616.46
7.3.240.0100.01416.41
7.3.230.0060.01216.44
7.3.210.0100.00716.42
7.3.200.0120.00919.39
7.3.190.0060.01116.44
7.3.180.0060.01516.52
7.3.170.0130.00316.46
7.3.160.0150.00616.50
7.3.130.0130.00615.16
7.3.120.0080.00814.95
7.3.110.0070.01314.80
7.3.100.0090.00614.87
7.3.90.0060.00914.98
7.3.80.0000.01014.80
7.3.70.0050.00514.76
7.3.60.0140.00314.86
7.3.50.0120.00014.86
7.3.40.0080.00414.89
7.3.30.0070.00714.96
7.3.20.0080.00316.81
7.3.10.0040.00816.82
7.3.00.0080.00416.55
7.2.330.0150.00916.48
7.2.320.0200.00316.76
7.2.310.0120.00716.91
7.2.300.0090.00916.77
7.2.290.0130.00316.61
7.2.260.0040.01415.33
7.2.250.0040.01515.06
7.2.240.0060.00915.03
7.2.230.0060.00614.90
7.2.220.0090.00615.12
7.2.210.0030.01015.09
7.2.200.0000.01515.31
7.2.190.0110.00315.13
7.2.180.0060.00915.26
7.2.170.0060.00315.15
7.2.160.0070.01014.95
7.2.150.0110.00716.96
7.2.140.0070.00717.15
7.2.130.0100.00717.18
7.2.120.0060.00716.74
7.2.110.0030.01016.70
7.2.100.0060.00916.98
7.2.90.0090.00616.96
7.2.80.0060.01016.84
7.2.70.0060.00617.01
7.2.60.0080.00317.01
7.2.50.0000.01416.90
7.2.40.0070.00316.97
7.2.30.0000.01516.75
7.2.20.0030.00616.91
7.2.10.0040.01116.71
7.2.00.0100.00316.91
7.1.330.0120.00315.88
7.1.320.0030.01515.79
7.1.310.0040.00415.59
7.1.300.0120.00615.89
7.1.290.0060.00615.65
7.1.280.0030.00715.70
7.1.270.0030.01415.58
7.1.260.0040.00715.75
7.1.250.0030.00916.00
7.1.240.0040.01215.52
7.1.230.0000.01515.91
7.1.220.0060.00315.75
7.1.210.0080.00415.76
7.1.200.0050.00815.81
7.1.190.0030.00615.68
7.1.180.0060.00315.90
7.1.170.0030.00915.80
7.1.160.0090.00315.91
7.1.150.0100.00315.54
7.1.140.0040.00715.90
7.1.130.0120.00315.82
7.1.120.0030.01015.61
7.1.110.0060.00615.78
7.1.100.0000.01316.00
7.1.90.0060.00916.01
7.1.80.0030.00715.59
7.1.70.0040.00616.62
7.1.60.0080.01117.58
7.1.50.0060.00716.43
7.1.40.0130.00015.86
7.1.30.0070.01115.62
7.1.20.0070.00716.02
7.1.10.0070.01015.71
7.1.00.0050.04019.16
7.0.330.0070.00715.24
7.0.320.0060.00315.38
7.0.310.0030.01015.48
7.0.300.0060.00315.49
7.0.290.0030.00715.23
7.0.280.0100.00315.18
7.0.270.0060.00615.51
7.0.260.0060.00915.65
7.0.250.0000.01115.37
7.0.240.0090.00615.44
7.0.230.0080.00815.20
7.0.220.0000.01215.27
7.0.210.0000.01015.27
7.0.200.0030.00815.86
7.0.190.0000.01315.34
7.0.180.0030.01015.42
7.0.170.0090.00615.31
7.0.160.0070.00715.39
7.0.150.0030.00615.50
7.0.140.0040.03618.62
7.0.130.0000.00915.47
7.0.120.0030.01315.28
7.0.110.0060.00915.32
7.0.100.0030.01315.36
7.0.90.0000.00915.43
7.0.80.0000.01415.52
7.0.70.0000.01015.54
7.0.60.0070.04417.71
7.0.50.0060.04316.73
7.0.40.0090.04616.85
7.0.30.0110.02516.87
7.0.20.0260.04516.88
7.0.10.0080.02216.80
7.0.00.0050.04716.85
5.6.400.0030.00614.48
5.6.390.0060.00614.40
5.6.380.0060.00614.44
5.6.370.0040.00414.37
5.6.360.0040.01214.33
5.6.350.0080.00414.03
5.6.340.0040.00414.35
5.6.330.0030.01014.56
5.6.320.0000.01114.48
5.6.310.0030.01414.17
5.6.300.0030.00914.38
5.6.290.0040.01114.60
5.6.280.0060.04017.83
5.6.270.0100.00714.62
5.6.260.0060.01214.49
5.6.250.0070.01114.38
5.6.240.0030.01014.61
5.6.230.0000.01414.79
5.6.220.0060.01014.57
5.6.210.0020.04817.62
5.6.200.0080.03216.39
5.6.190.0030.03317.64
5.6.180.0300.03817.44
5.6.170.0250.03817.60
5.6.160.0060.02317.50
5.6.150.0070.03316.45
5.6.140.0030.03216.35
5.6.130.0090.04016.34
5.6.120.0080.04117.55
5.6.110.0080.04517.76
5.6.100.0120.03317.76
5.6.90.0070.04017.56
5.6.80.0030.04617.39
5.6.70.0040.01114.41
5.6.60.0000.01514.62
5.6.50.0040.00914.29
5.6.40.0000.01414.11
5.6.30.0030.00714.20
5.6.20.0090.00014.45
5.6.10.0000.01214.48
5.6.00.0100.00314.47
5.5.380.0000.01014.44
5.5.370.0130.00314.46
5.5.360.0070.00714.35
5.5.350.0110.01817.48
5.5.340.0050.02816.38
5.5.330.0070.04617.38
5.5.320.0150.02617.36
5.5.310.0160.04317.23
5.5.300.0050.04116.36
5.5.290.0130.04216.25
5.5.280.0110.04317.63
5.5.270.0100.04317.56
5.5.260.0160.02817.47
5.5.250.0100.04217.61
5.5.240.0100.04717.29
5.5.230.0060.01214.20
5.5.220.0120.00614.25
5.5.210.0090.00914.49
5.5.200.0060.00914.28
5.5.190.0090.00014.06
5.5.180.0000.01314.13
5.5.170.0030.01014.50
5.5.160.0060.00914.48
5.5.150.0030.01014.48
5.5.140.0000.01414.23
5.5.130.0040.01114.30
5.5.120.0040.01214.35
5.5.110.0070.00714.27
5.5.100.0060.00914.38
5.5.90.0040.01114.53
5.5.80.0030.00714.13
5.5.70.0110.00414.46
5.5.60.0090.00614.25
5.5.50.0090.00614.05
5.5.40.0120.00414.34
5.5.30.0070.00414.41
5.5.20.0080.00814.59
5.5.10.0070.00714.36
5.5.00.0070.00714.45
5.4.450.0420.02615.38
5.4.440.0230.03215.43
5.4.430.0080.03515.35
5.4.420.0330.00415.22
5.4.410.0370.00215.23
5.4.400.0340.00115.15
5.4.390.0330.00315.35
5.4.380.0220.03214.96
5.4.370.0200.03014.89
5.4.360.0210.02814.94
5.4.350.0220.03314.74
5.4.340.0210.02714.93
5.4.330.0000.01110.97
5.4.320.0040.02211.72
5.4.310.0030.02311.70
5.4.300.0060.02311.86
5.4.290.0070.02211.88
5.4.280.0020.02211.85
5.4.270.0020.02111.75
5.4.260.0050.02111.76
5.4.250.0070.01811.86
5.4.240.0050.02311.56
5.4.230.0040.02111.85
5.4.220.0040.02611.59
5.4.210.0060.02311.61
5.4.200.0040.02511.83
5.4.190.0060.02011.71
5.4.180.0050.02311.75
5.4.170.0090.01911.81
5.4.160.0070.02511.84
5.4.150.0090.02111.75
5.4.140.0100.02011.46
5.4.130.0070.02211.57
5.4.120.0040.02211.49
5.4.110.0070.01811.56
5.4.100.0040.02311.63
5.4.90.0050.02111.58
5.4.80.0040.02811.55
5.4.70.0050.02211.55
5.4.60.0060.02111.58
5.4.50.0070.01911.62
5.4.40.0040.02211.72
5.4.30.0090.02211.42
5.4.20.0060.02111.42
5.4.10.0050.02111.60
5.4.00.0090.01611.23
5.3.290.0080.04512.80
5.3.280.0060.03812.71
5.3.270.0050.04212.72
5.3.260.0090.03912.73
5.3.250.0100.03912.73
5.3.240.0060.03712.73
5.3.230.0030.04112.72
5.3.220.0040.03812.69
5.3.210.0060.04512.69
5.3.200.0080.03712.68
5.3.190.0080.03812.69
5.3.180.0070.04112.69
5.3.170.0050.03612.68
5.3.160.0080.03912.69
5.3.150.0050.03912.68
5.3.140.0050.03612.67
5.3.130.0050.04512.68
5.3.120.0050.04012.67
5.3.110.0090.03712.67
5.3.100.0060.04412.16
5.3.90.0050.03812.14
5.3.80.0080.03812.13
5.3.70.0040.03712.13
5.3.60.0070.04012.11
5.3.50.0060.03512.06
5.3.40.0050.04412.07
5.3.30.0100.03312.04
5.3.20.0060.03911.80
5.3.10.0080.04311.76
5.3.00.0100.03811.76
5.2.170.0070.0329.27
5.2.160.0060.0349.27
5.2.150.0060.0379.26
5.2.140.0040.0359.25
5.2.130.0070.0269.22
5.2.120.0060.0329.22
5.2.110.0090.0329.23
5.2.100.0050.0299.22
5.2.90.0050.0309.22
5.2.80.0050.0339.21
5.2.70.0050.0319.21
5.2.60.0030.0329.18
5.2.50.0050.0299.14
5.2.40.0050.0349.12
5.2.30.0080.0369.09
5.2.20.0070.0319.08
5.2.10.0080.0298.99
5.2.00.0030.0318.85
5.1.60.0050.0228.13
5.1.50.0040.0248.13
5.1.40.0040.0248.11
5.1.30.0040.0268.46
5.1.20.0030.0298.48
5.1.10.0010.0288.21
5.1.00.0030.0308.20
5.0.50.0040.0236.67
5.0.40.0020.0266.53
5.0.30.0020.0336.34
5.0.20.0030.0196.31
5.0.10.0030.0266.29
5.0.00.0040.0296.28
4.4.90.0060.0144.78
4.4.80.0020.0154.76
4.4.70.0040.0144.75
4.4.60.0010.0174.76
4.4.50.0020.0154.77
4.4.40.0000.0274.71
4.4.30.0010.0174.76
4.4.20.0010.0174.84
4.4.10.0010.0174.85
4.4.00.0020.0254.76
4.3.110.0030.0174.67
4.3.100.0010.0174.66
4.3.90.0030.0144.63
4.3.80.0040.0234.58
4.3.70.0010.0154.63
4.3.60.0040.0134.62
4.3.50.0020.0164.63
4.3.40.0060.0284.54
4.3.30.0030.0203.30
4.3.20.0030.0153.28
4.3.10.0020.0153.23
4.3.00.0300.03316.39

preferences:
37.42 ms | 401 KiB | 5 Q