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->moredata, parent::serialize(), )); } public function unserialize($data) { $orgdata = unserialize($data); $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.0070.01418.43
8.3.50.0100.00922.01
8.3.40.0090.00618.76
8.3.30.0090.00919.22
8.3.20.0040.00420.13
8.3.10.0050.00320.48
8.3.00.0060.00319.63
8.2.180.0110.01116.50
8.2.170.0110.00722.96
8.2.160.0070.01420.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0090.00022.10
8.2.110.0060.00320.31
8.2.100.0040.00718.09
8.2.90.0000.00819.36
8.2.80.0090.00017.97
8.2.70.0070.00217.75
8.2.60.0090.00017.93
8.2.50.0080.00018.07
8.2.40.0050.00318.28
8.2.30.0030.00519.33
8.2.20.0050.00317.93
8.2.10.0030.00618.13
8.2.00.0000.00717.88
8.1.280.0070.01425.92
8.1.270.0060.00323.88
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.00022.23
8.1.230.0030.00719.21
8.1.220.0000.00817.77
8.1.210.0030.00618.77
8.1.200.0030.00617.36
8.1.190.0050.00317.23
8.1.180.0030.00518.10
8.1.170.0030.00718.54
8.1.160.0040.00421.96
8.1.150.0000.00818.82
8.1.140.0070.00017.48
8.1.130.0070.00017.84
8.1.120.0070.00017.54
8.1.110.0080.00017.47
8.1.100.0040.00417.50
8.1.90.0000.00917.47
8.1.80.0090.00017.49
8.1.70.0050.00317.41
8.1.60.0000.01017.62
8.1.50.0040.00417.55
8.1.40.0040.00417.54
8.1.30.0040.00417.62
8.1.20.0040.00417.50
8.1.10.0040.00417.49
8.1.00.0000.00817.37
8.0.300.0000.00818.77
8.0.290.0000.00716.75
8.0.280.0030.00318.34
8.0.270.0050.00217.27
8.0.260.0080.00017.33
8.0.250.0040.00417.02
8.0.240.0050.00217.09
8.0.230.0000.00717.06
8.0.220.0070.00016.97
8.0.210.0000.00716.86
8.0.200.0040.00416.93
8.0.190.0040.00416.95
8.0.180.0040.00417.01
8.0.170.0040.00417.04
8.0.160.0040.00417.00
8.0.150.0000.00916.93
8.0.140.0040.00416.85
8.0.130.0050.00013.43
8.0.120.0000.00716.96
8.0.110.0030.00517.04
8.0.100.0080.00016.78
8.0.90.0060.00316.96
8.0.80.0080.01216.92
8.0.70.0050.00316.82
8.0.60.0040.00416.84
8.0.50.0040.00416.98
8.0.30.0150.00816.96
8.0.20.0100.01017.40
8.0.10.0070.00017.10
8.0.00.0080.01316.78
7.4.330.0000.00515.09
7.4.320.0060.00016.62
7.4.300.0030.00316.51
7.4.290.0000.00716.51
7.4.280.0030.00616.41
7.4.270.0000.00716.61
7.4.260.0040.00416.52
7.4.250.0020.00516.58
7.4.240.0050.00216.50
7.4.230.0000.00716.46
7.4.220.0160.00316.56
7.4.210.0080.00516.65
7.4.200.0000.00716.71
7.4.160.0030.01716.33
7.4.150.0090.00917.40
7.4.140.0100.01117.86
7.4.130.0110.01116.57
7.4.120.0030.01416.63
7.4.110.0100.01016.52
7.4.100.0090.00916.72
7.4.90.0120.00916.55
7.4.80.0070.01118.80
7.4.70.0050.01316.71
7.4.60.0080.00816.70
7.4.50.0000.00916.68
7.4.40.0130.00316.31
7.4.30.0000.01716.81
7.4.10.0070.01314.97
7.4.00.0110.00514.93
7.3.330.0070.00013.46
7.3.320.0000.00613.29
7.3.310.0000.00816.49
7.3.300.0030.00316.48
7.3.290.0110.00416.44
7.3.280.0100.00616.47
7.3.270.0100.00717.40
7.3.260.0020.01716.51
7.3.250.0100.00716.48
7.3.240.0100.01416.35
7.3.230.0070.01016.39
7.3.210.0070.01016.54
7.3.200.0090.00919.39
7.3.190.0150.00916.59
7.3.180.0000.01916.47
7.3.170.0070.01016.54
7.3.160.0120.00916.41
7.3.130.0110.00614.92
7.3.120.0050.01214.86
7.3.110.0050.01314.81
7.3.100.0040.01114.88
7.3.90.0040.00914.84
7.3.80.0060.00714.97
7.3.70.0100.00514.86
7.3.60.0050.01114.78
7.3.50.0050.00714.91
7.3.40.0030.01114.92
7.3.30.0050.00714.94
7.3.20.0070.00716.70
7.3.10.0020.01016.57
7.3.00.0080.00616.64
7.2.330.0150.00316.66
7.2.320.0030.01816.37
7.2.310.0050.01416.85
7.2.300.0070.01016.45
7.2.290.0070.01016.94
7.2.260.0030.01615.26
7.2.250.0050.01315.05
7.2.240.0030.01515.19
7.2.230.0100.00715.28
7.2.220.0060.01115.34
7.2.210.0070.00715.25
7.2.200.0020.00815.00
7.2.190.0090.00615.03
7.2.180.0060.00715.15
7.2.170.0070.00515.22
7.2.160.0030.00815.17
7.2.150.0040.01116.64
7.2.140.0000.01116.90
7.2.130.0060.01016.86
7.2.120.0060.00316.84
7.2.110.0060.00916.91
7.2.100.0110.00416.75
7.2.90.0080.00817.02
7.2.80.0130.00316.89
7.2.70.0030.01016.92
7.2.60.0060.01017.21
7.2.50.0040.00817.08
7.2.40.0000.01316.92
7.2.30.0110.00317.04
7.2.20.0120.00016.86
7.2.10.0040.00817.06
7.2.00.0060.00316.64
7.1.330.0070.01015.93
7.1.320.0030.00715.78
7.1.310.0080.00316.00
7.1.300.0100.00515.87
7.1.290.0060.00715.92
7.1.280.0070.00415.54
7.1.270.0050.00715.73
7.1.260.0030.01215.78
7.1.250.0100.00715.98
7.1.240.0000.01315.51
7.1.230.0100.00315.77
7.1.220.0100.00315.71
7.1.210.0030.00715.89
7.1.200.0040.00816.01
7.1.190.0070.00715.68
7.1.180.0040.01115.71
7.1.170.0110.00315.74
7.1.160.0030.01015.98
7.1.150.0100.00015.87
7.1.140.0070.01015.68
7.1.130.0070.00715.97
7.1.120.0040.00415.59
7.1.110.0030.01315.95
7.1.100.0030.01015.86
7.1.90.0060.00315.80
7.1.80.0030.01015.93
7.1.70.0020.00916.30
7.1.60.0030.01317.58
7.1.50.0020.01716.32
7.1.40.0060.00315.73
7.1.30.0080.00616.02
7.1.20.0030.00915.69
7.1.10.0040.00815.76
7.1.00.0070.04019.16
7.0.330.0030.00615.32
7.0.320.0000.00815.32
7.0.310.0100.00015.22
7.0.300.0000.01115.48
7.0.290.0040.00815.34
7.0.280.0140.00015.38
7.0.270.0060.00315.46
7.0.260.0030.00915.38
7.0.250.0070.00715.23
7.0.240.0050.00815.52
7.0.230.0030.00615.32
7.0.220.0030.01015.53
7.0.210.0000.00815.52
7.0.200.0070.00516.12
7.0.190.0040.00415.60
7.0.180.0050.00315.36
7.0.170.0030.01015.43
7.0.160.0110.00015.27
7.0.150.0000.01215.51
7.0.140.0040.04118.75
7.0.130.0030.01015.49
7.0.120.0030.00915.50
7.0.110.0090.00615.35
7.0.100.0030.01015.38
7.0.90.0070.00715.36
7.0.80.0080.00015.24
7.0.70.0070.00715.21
7.0.60.0040.04717.75
7.0.50.0070.04516.79
7.0.40.0080.04216.86
7.0.30.0300.04016.91
7.0.20.0030.03016.84
7.0.10.0050.04916.75
7.0.00.0060.02816.79
5.6.400.0030.00614.27
5.6.390.0040.00914.63
5.6.380.0040.00714.65
5.6.370.0070.00314.60
5.6.360.0110.00414.27
5.6.350.0060.00314.27
5.6.340.0000.01314.40
5.6.330.0030.01314.29
5.6.320.0080.00514.37
5.6.310.0000.01214.50
5.6.300.0100.00614.31
5.6.290.0060.01214.51
5.6.280.0080.03817.85
5.6.270.0070.00714.21
5.6.260.0060.01014.21
5.6.250.0060.00914.56
5.6.240.0060.01014.52
5.6.230.0100.00714.41
5.6.220.0000.01714.63
5.6.210.0120.04317.43
5.6.200.0050.04516.35
5.6.190.0100.04217.47
5.6.180.0030.03317.61
5.6.170.0150.03817.39
5.6.160.0020.03617.47
5.6.150.0050.04616.28
5.6.140.0100.03816.20
5.6.130.0030.04916.46
5.6.120.0110.04117.68
5.6.110.0030.05017.75
5.6.100.0080.03517.88
5.6.90.0050.04917.58
5.6.80.0060.04217.55
5.6.70.0040.00814.59
5.6.60.0030.00914.21
5.6.50.0000.01814.31
5.6.40.0030.00614.36
5.6.30.0110.00414.34
5.6.20.0030.00614.47
5.6.10.0060.00914.46
5.6.00.0000.00914.36
5.5.380.0000.00914.39
5.5.370.0000.01414.34
5.5.360.0030.00614.16
5.5.350.0240.03217.42
5.5.340.0090.02016.19
5.5.330.0060.03117.14
5.5.320.0070.04317.49
5.5.310.0170.03317.26
5.5.300.0050.04516.12
5.5.290.0070.04216.19
5.5.280.0120.03517.59
5.5.270.0030.04017.51
5.5.260.0090.02317.38
5.5.250.0120.03417.43
5.5.240.0170.04317.38
5.5.230.0090.00314.00
5.5.220.0030.01014.35
5.5.210.0040.00414.32
5.5.200.0130.00314.36
5.5.190.0090.00014.15
5.5.180.0070.00313.86
5.5.170.0030.01014.29
5.5.160.0030.00614.32
5.5.150.0040.01114.11
5.5.140.0040.00414.53
5.5.130.0000.01614.11
5.5.120.0030.01314.28
5.5.110.0040.00814.38
5.5.100.0000.01314.13
5.5.90.0060.00613.90
5.5.80.0060.00613.96
5.5.70.0090.00314.42
5.5.60.0030.01114.11
5.5.50.0060.00914.33
5.5.40.0030.01314.21
5.5.30.0090.00314.16
5.5.20.0070.00714.30
5.5.10.0090.00314.42
5.5.00.0000.00914.29
5.4.450.0230.03915.15
5.4.440.0500.03315.40
5.4.430.0420.03615.18
5.4.420.0330.00615.44
5.4.410.0330.00615.21
5.4.400.0340.00414.91
5.4.390.0420.00615.15
5.4.380.0270.02714.81
5.4.370.0180.03014.74
5.4.360.0200.02814.92
5.4.350.0200.03214.82
5.4.340.0150.03314.93
5.4.330.0040.00710.80
5.4.320.0060.01911.91
5.4.310.0050.02311.80
5.4.300.0020.02211.71
5.4.290.0050.02011.84
5.4.280.0040.02311.61
5.4.270.0040.02411.85
5.4.260.0050.02411.81
5.4.250.0030.02211.78
5.4.240.0030.02411.81
5.4.230.0080.02111.67
5.4.220.0070.02111.58
5.4.210.0040.02111.59
5.4.200.0040.02611.58
5.4.190.0060.02311.69
5.4.180.0050.02611.61
5.4.170.0060.02111.68
5.4.160.0030.02411.71
5.4.150.0060.02311.79
5.4.140.0070.02211.47
5.4.130.0030.02511.61
5.4.120.0070.01711.51
5.4.110.0040.02411.38
5.4.100.0060.02111.53
5.4.90.0040.02111.50
5.4.80.0050.02611.56
5.4.70.0050.02311.53
5.4.60.0040.02511.60
5.4.50.0070.02411.48
5.4.40.0020.02611.56
5.4.30.0040.02611.58
5.4.20.0020.02311.59
5.4.10.0060.02211.40
5.4.00.0050.02211.15
5.3.290.0080.03812.80
5.3.280.0090.03512.71
5.3.270.0070.04012.73
5.3.260.0080.03512.72
5.3.250.0050.03712.72
5.3.240.0070.03512.72
5.3.230.0050.03712.71
5.3.220.0090.03912.69
5.3.210.0080.03912.69
5.3.200.0090.04112.68
5.3.190.0060.03712.68
5.3.180.0100.03712.68
5.3.170.0080.03912.68
5.3.160.0090.03612.68
5.3.150.0110.03512.68
5.3.140.0080.03512.67
5.3.130.0040.04012.66
5.3.120.0060.03812.66
5.3.110.0050.04112.66
5.3.100.0050.03912.15
5.3.90.0080.03612.13
5.3.80.0060.03712.13
5.3.70.0080.04412.12
5.3.60.0080.04512.11
5.3.50.0070.04112.06
5.3.40.0070.03812.05
5.3.30.0040.03512.02
5.3.20.0080.03911.79
5.3.10.0070.04611.76
5.3.00.0060.04111.75
5.2.170.0080.0319.26
5.2.160.0020.0349.26
5.2.150.0060.0309.26
5.2.140.0070.0329.25
5.2.130.0050.0299.21
5.2.120.0040.0289.22
5.2.110.0050.0319.22
5.2.100.0030.0339.21
5.2.90.0080.0339.21
5.2.80.0080.0299.21
5.2.70.0060.0299.21
5.2.60.0050.0329.16
5.2.50.0070.0309.13
5.2.40.0090.0329.11
5.2.30.0050.0309.08
5.2.20.0040.0309.08
5.2.10.0030.0308.98
5.2.00.0090.0248.84
5.1.60.0040.0248.12
5.1.50.0100.0208.12
5.1.40.0070.0248.10
5.1.30.0030.0308.45
5.1.20.0040.0278.47
5.1.10.0070.0278.19
5.1.00.0050.0258.19
5.0.50.0030.0246.67
5.0.40.0030.0256.53
5.0.30.0050.0316.34
5.0.20.0050.0186.31
5.0.10.0030.0196.29
5.0.00.0030.0306.28
4.4.90.0020.0164.78
4.4.80.0040.0144.76
4.4.70.0040.0154.75
4.4.60.0060.0124.75
4.4.50.0050.0134.77
4.4.40.0040.0244.71
4.4.30.0040.0144.76
4.4.20.0060.0194.84
4.4.10.0030.0154.85
4.4.00.0030.0254.76
4.3.110.0020.0194.67
4.3.100.0000.0204.66
4.3.90.0060.0164.63
4.3.80.0030.0244.58
4.3.70.0030.0174.63
4.3.60.0050.0144.63
4.3.50.0030.0154.63
4.3.40.0020.0314.54
4.3.30.0020.0173.30
4.3.20.0020.0163.28
4.3.10.0020.0163.24
4.3.00.0200.01716.39

preferences:
33.8 ms | 401 KiB | 5 Q