3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testClass_forSerialize implements Serializable{ public function serialize() { // use array instead of stdClass $ret = Array(); foreach($this as $k=>$v){ if ($v!==null) { $ret[$k] = $v; } } $serializedData = serialize($ret); if (unserialize($serializedData)===false) { var_dump($serializedData); throw new \Exception("Serialize failed"); } return $serializedData; } public function unserialize($data) { $dataObj = unserialize($data); foreach($dataObj as $k=>$v) { $this->{$k} = $v; } } } class testClass_forSerialize_02 extends \testClass_forSerialize{ public $list = Array(); public function __construct() { for ($i=0; $i<10; $i++) { $this->list[] = new \testClass_forSerialize(); } } } $obj = new \testClass_forSerialize_02(); $ser = serialize($obj); $obj2 = unserialize($ser);

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.40.0070.01419.01
8.3.30.0070.00719.22
8.3.20.0000.00820.13
8.3.10.0050.00321.91
8.3.00.0080.00019.06
8.2.170.0190.00019.08
8.2.160.0100.00722.96
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00219.89
8.2.110.0050.00519.45
8.2.100.0040.00817.84
8.2.90.0090.00019.21
8.2.80.0000.00917.97
8.2.70.0080.00317.63
8.2.60.0060.00617.93
8.2.50.0000.01018.07
8.2.40.0060.00320.07
8.2.30.0000.00718.25
8.2.20.0040.00417.75
8.2.10.0000.00718.20
8.2.00.0050.00317.71
8.1.270.0030.00618.95
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0080.00322.63
8.1.230.0090.00320.90
8.1.220.0000.00817.74
8.1.210.0060.00318.97
8.1.200.0000.00917.35
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0040.00418.45
8.1.160.0040.00421.94
8.1.150.0000.00918.86
8.1.140.0000.00717.46
8.1.130.0040.00419.15
8.1.120.0040.00417.39
8.1.110.0000.00717.50
8.1.100.0000.00717.48
8.1.90.0000.00717.49
8.1.80.0000.00717.45
8.1.70.0000.00717.42
8.1.60.0040.00417.63
8.1.50.0050.00317.53
8.1.40.0030.00617.50
8.1.30.0000.00817.70
8.1.20.0000.00717.49
8.1.10.0060.00317.46
8.1.00.0080.00017.47
8.0.300.0040.00420.02
8.0.290.0040.00416.75
8.0.280.0000.00718.46
8.0.270.0000.00716.80
8.0.260.0080.00016.80
8.0.250.0000.00717.01
8.0.240.0000.00617.03
8.0.230.0040.00417.09
8.0.220.0000.00716.95
8.0.210.0000.00716.92
8.0.200.0030.00316.91
8.0.190.0000.00717.04
8.0.180.0070.00016.99
8.0.170.0020.00517.05
8.0.160.0000.00916.96
8.0.150.0040.00416.93
8.0.140.0040.00416.95
8.0.130.0000.00513.37
8.0.120.0040.00416.96
8.0.110.0050.00316.95
8.0.100.0080.00016.85
8.0.90.0050.00316.86
8.0.80.0110.00716.91
8.0.70.0050.00317.02
8.0.60.0050.00216.93
8.0.50.0000.00716.94
8.0.30.0000.01517.34
8.0.20.0110.00817.40
8.0.10.0070.00016.96
8.0.00.0090.00916.85
7.4.330.0000.00515.03
7.4.320.0040.00416.53
7.4.300.0000.00616.54
7.4.290.0000.00716.37
7.4.280.0040.00416.65
7.4.270.0000.00816.58
7.4.260.0030.00316.46
7.4.250.0000.00716.48
7.4.240.0040.00316.55
7.4.230.0070.00016.68
7.4.220.0150.00916.58
7.4.210.0070.01316.63
7.4.200.0030.00316.42
7.4.160.0030.01416.66
7.4.150.0100.00717.40
7.4.140.0140.00617.86
7.4.130.0100.00816.46
7.4.120.0100.00916.42
7.4.110.0140.00316.47
7.4.100.0060.01216.50
7.4.90.0120.00416.55
7.4.80.0060.01219.39
7.4.70.0080.00816.49
7.4.60.0110.00716.59
7.4.50.0080.00016.48
7.4.40.0060.01016.63
7.4.30.0180.00016.50
7.4.10.0000.01915.12
7.4.00.0000.01415.10
7.3.330.0060.00013.40
7.3.320.0030.00313.27
7.3.310.0000.00716.36
7.3.300.0060.00016.44
7.3.290.0090.00716.37
7.3.280.0100.00816.41
7.3.270.0160.00317.40
7.3.260.0070.01016.45
7.3.250.0090.00816.64
7.3.240.0170.00016.36
7.3.230.0100.00916.68
7.3.210.0070.01016.43
7.3.200.0040.01719.39
7.3.190.0030.01316.60
7.3.180.0030.01316.34
7.3.170.0090.00616.69
7.3.160.0060.01416.47
7.3.130.0090.00615.01
7.3.120.0070.01115.09
7.3.110.0090.00615.06
7.3.100.0080.00415.00
7.3.90.0100.00315.13
7.3.80.0090.00015.02
7.3.70.0070.00314.97
7.3.60.0000.01414.88
7.3.50.0060.00614.81
7.3.40.0060.00914.72
7.3.30.0030.01314.94
7.3.20.0030.01016.68
7.3.10.0060.00616.66
7.3.00.0000.01516.55
7.2.330.0100.00716.84
7.2.320.0130.00716.79
7.2.310.0110.00616.45
7.2.300.0100.00716.58
7.2.290.0090.00916.88
7.2.260.0070.01414.82
7.2.250.0090.00915.27
7.2.240.0030.01015.17
7.2.230.0080.00615.07
7.2.220.0100.00714.79
7.2.210.0030.01015.30
7.2.200.0090.00315.05
7.2.190.0090.00315.05
7.2.180.0060.00914.85
7.2.170.0040.00815.25
7.2.160.0060.00914.87
7.2.150.0040.01217.09
7.2.140.0040.01216.66
7.2.130.0120.00617.03
7.2.120.0030.00917.10
7.2.110.0030.00916.99
7.2.100.0090.00616.78
7.2.90.0100.00716.99
7.2.80.0060.00917.04
7.2.70.0040.01016.76
7.2.60.0030.01016.68
7.2.50.0060.00616.97
7.2.40.0090.00616.84
7.2.30.0060.00616.75
7.2.20.0090.00617.03
7.2.10.0090.00616.65
7.2.00.0080.00818.02
7.1.330.0040.01115.68
7.1.320.0090.00615.66
7.1.310.0070.00315.78
7.1.300.0030.00715.77
7.1.290.0060.00615.86
7.1.280.0040.00715.89
7.1.270.0100.00615.95
7.1.260.0030.00615.61
7.1.250.0030.01415.87
7.1.240.0120.00015.73
7.1.230.0040.01115.70
7.1.220.0040.00715.88
7.1.210.0080.00815.81
7.1.200.0040.01015.85
7.1.190.0030.01315.87
7.1.180.0040.00815.91
7.1.170.0000.01215.79
7.1.160.0090.00615.54
7.1.150.0070.00315.64
7.1.140.0070.01015.88
7.1.130.0000.00915.80
7.1.120.0080.00815.89
7.1.110.0060.00615.91
7.1.100.0050.00916.80
7.1.90.0090.00615.69
7.1.80.0080.00015.63
7.1.70.0070.00516.29
7.1.60.0050.01317.70
7.1.50.0080.01116.47
7.1.40.0090.00415.44
7.1.30.0030.00615.82
7.1.20.0030.00615.81
7.1.10.0030.01015.77
7.1.00.0050.04218.98
7.0.330.0110.00315.19
7.0.320.0100.00715.15
7.0.310.0080.00315.50
7.0.300.0030.01015.17
7.0.290.0090.00315.33
7.0.280.0100.00315.07
7.0.270.0040.00415.23
7.0.260.0070.00715.39
7.0.250.0040.00815.48
7.0.240.0070.00715.46
7.0.230.0120.00315.39
7.0.220.0000.00815.36
7.0.210.0070.00715.32
7.0.200.0020.00716.16
7.0.190.0000.01415.23
7.0.180.0080.00015.53
7.0.170.0080.00015.51
7.0.160.0080.00415.45
7.0.150.0120.00315.49
7.0.140.0020.02218.58
7.0.130.0070.00315.45
7.0.120.0000.01115.23
7.0.110.0060.00615.27
7.0.100.0130.00315.15
7.0.90.0030.00515.49
7.0.80.0040.00415.50
7.0.70.0000.01715.61
7.0.60.0040.02417.65
7.0.50.0070.02816.57
7.0.40.0070.04316.73
7.0.30.0150.02016.94
7.0.20.0120.02716.90
7.0.10.0070.04516.79
7.0.00.0030.04516.79
5.6.400.0040.01214.29
5.6.390.0040.01414.61
5.6.380.0060.01314.44
5.6.370.0040.00414.69
5.6.360.0040.01214.31
5.6.350.0040.01114.49
5.6.340.0070.01014.40
5.6.330.0000.01114.52
5.6.320.0030.01214.26
5.6.310.0040.00714.20
5.6.300.0030.01314.77
5.6.290.0030.01314.48
5.6.280.0060.03917.62
5.6.270.0060.00314.86
5.6.260.0060.00914.44
5.6.250.0040.00414.48
5.6.240.0030.00614.45
5.6.230.0060.00914.41
5.6.220.0060.00914.45
5.6.210.0070.03817.47
5.6.200.0020.03816.31
5.6.190.0020.02717.52
5.6.180.0070.04217.43
5.6.170.0160.04617.60
5.6.160.0050.04717.36
5.6.150.0090.03916.29
5.6.140.0020.04616.40
5.6.130.0050.03016.38
5.6.120.0030.02517.81
5.6.110.0040.04917.77
5.6.100.0030.05017.92
5.6.90.0080.04817.61
5.6.80.0070.04517.37
5.6.70.0080.00814.60
5.6.60.0060.00914.45
5.6.50.0060.00314.07
5.6.40.0060.01014.48
5.6.30.0030.00614.18
5.6.20.0050.00514.43
5.6.10.0040.01114.27
5.6.00.0030.01014.29
5.5.380.0060.00914.53
5.5.370.0030.01314.56
5.5.360.0030.01014.09
5.5.350.0150.04517.49
5.5.340.0100.04016.17
5.5.330.0050.04617.39
5.5.320.0130.03517.41
5.5.310.0140.03617.42
5.5.300.0070.04316.10
5.5.290.0030.05016.26
5.5.280.0050.03017.86
5.5.270.0070.04217.61
5.5.260.0110.04117.67
5.5.250.0020.02717.49
5.5.240.0180.03917.35
5.5.230.0060.01214.11
5.5.220.0100.01014.11
5.5.210.0090.00014.14
5.5.200.0060.00914.35
5.5.190.0030.00714.32
5.5.180.0030.00614.32
5.5.170.0070.00414.58
5.5.160.0040.00414.42
5.5.150.0030.01014.24
5.5.140.0060.00314.14
5.5.130.0030.00714.13
5.5.120.0070.00714.26
5.5.110.0000.01014.27
5.5.100.0040.01114.21
5.5.90.0100.00314.33
5.5.80.0070.01114.45
5.5.70.0060.00314.30
5.5.60.0120.00314.19
5.5.50.0030.00914.38
5.5.40.0100.00714.32
5.5.30.0130.00314.37
5.5.20.0040.00414.34
5.5.10.0030.01014.46
5.5.00.0000.01414.50
5.4.450.0400.03215.40
5.4.440.0370.03515.26
5.4.430.0070.02915.18
5.4.420.0030.03215.24
5.4.410.0100.02615.17
5.4.400.0120.02515.11
5.4.390.0050.03315.22
5.4.380.0100.02715.10
5.4.370.0070.03314.95
5.4.360.0130.02515.12
5.4.350.0100.03014.89
5.4.340.0120.02715.02
5.4.330.0060.00611.28
5.4.320.0080.03414.83
5.4.310.0100.03014.90
5.4.300.0120.02914.96
5.4.290.0070.03314.98
5.4.280.0170.02414.99
5.4.270.0080.03314.91
5.4.260.0080.03214.96
5.4.250.0120.02714.84
5.4.240.0100.03714.92
5.4.230.0150.02515.11
5.4.220.0150.02814.77
5.4.210.0080.02814.80
5.4.200.0070.03113.84
5.4.190.0130.02514.92
5.4.180.0100.02914.99
5.4.170.0100.03014.94
5.4.160.0130.02614.94
5.4.150.0080.03014.85
5.4.140.0100.02913.84
5.4.130.0150.02513.66
5.4.120.0110.03313.83
5.4.110.0120.02813.91
5.4.100.0180.02513.83
5.4.90.0130.02313.73
5.4.80.0080.02813.81
5.4.70.0080.03213.67
5.4.60.0070.03313.62
5.4.50.0130.02613.77
5.4.40.0130.02813.80
5.4.30.0080.03013.55
5.4.20.0110.02613.59
5.4.10.0080.02913.63
5.4.00.0080.03013.54
5.3.290.0170.05714.90
5.3.280.0230.04714.75
5.3.270.0130.05714.70
5.3.260.0200.05014.78
5.3.250.0130.05314.69
5.3.240.0100.06014.68
5.3.230.0230.04714.69
5.3.220.0130.05714.88
5.3.210.0200.05014.59
5.3.200.0270.04314.69
5.3.190.0170.05014.65
5.3.180.0070.06014.63
5.3.170.0130.05314.68
5.3.160.0130.05314.68
5.3.150.0270.04314.77
5.3.140.0170.05014.57
5.3.130.0300.04314.60
5.3.120.0070.06314.86
5.3.110.0270.04714.58
5.3.100.0170.05314.26
5.3.90.0400.05314.09
5.3.80.0200.05014.07
5.3.70.0170.05014.18
5.3.60.0130.05314.15
5.3.50.0170.05314.00
5.3.40.0330.04714.01
5.3.30.0170.04714.07
5.3.20.0200.04713.85
5.3.10.0200.04713.73
5.3.00.0170.05013.71
5.2.170.0170.04011.16
5.2.160.0100.04311.25
5.2.150.0130.04311.23
5.2.140.0230.04311.19
5.2.130.0130.04011.26
5.2.120.0130.04011.24
5.2.110.0170.03711.14
5.2.100.0030.05011.14
5.2.90.0100.04711.24
5.2.80.0130.04011.18
5.2.70.0030.05311.25
5.2.60.0130.04311.18
5.2.50.0130.04011.09
5.2.40.0130.04011.25
5.2.30.0100.04311.03
5.2.20.0030.04711.03
5.2.10.0030.04710.94
5.2.00.0070.04710.73
5.1.60.0070.04010.07
5.1.50.0130.03310.03
5.1.40.0100.03710.01
5.1.30.0070.04010.57
5.1.20.0100.03710.59
5.1.10.0100.03710.23
5.1.00.0130.03310.14
5.0.50.0070.0308.60
5.0.40.0070.0278.45
5.0.30.0070.0438.44
5.0.20.0000.0478.34
5.0.10.0100.0238.40
5.0.00.0070.0438.17
4.4.90.0070.0205.89
4.4.80.0030.0235.86
4.4.70.0070.0205.89
4.4.60.0100.0175.86
4.4.50.0100.0206.00
4.4.40.0000.0405.91
4.4.30.0130.0236.01
4.4.20.0030.0235.94
4.4.10.0070.0205.98
4.4.00.0070.0335.95
4.3.110.0100.0175.82
4.3.100.0070.0205.83
4.3.90.0100.0175.79
4.3.80.0030.0375.83
4.3.70.0030.0235.85
4.3.60.0100.0175.90
4.3.50.0070.0205.77
4.3.40.0070.0335.75
4.3.30.0030.0234.57
4.3.20.0030.0234.62
4.3.10.0000.0274.54
4.3.00.0170.0177.12

preferences:
48.49 ms | 400 KiB | 5 Q