3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Role implements \Serializable { protected $id = 0; protected $b = null; public function __construct($id) { $this->id = $id; } public function serialize() { return serialize([$this->id, $this->b]); } public function unserialize($serialized) { list($this->id, $this->b) = unserialize($serialized); } } class AbstractToken implements \Serializable { public $role1; public $role2; public function __construct($role) { $this->role1 = $role; $this->role2 = $role; } public function serialize() { return serialize([$this->role1, $this->role2]); } public function unserialize($serialized) { list($this->role1, $this->role2) = unserialize($serialized); } } class Token extends AbstractToken { public $id; public function __construct($id, $role) { $this->id = $id; parent::__construct($role); } public function serialize() { return serialize([$this->id, parent::serialize()]); } public function unserialize($serialized) { list($this->id, $parentStr) = unserialize($serialized); parent::unserialize($parentStr); } } $token = new Token(1, new Role(1)); $s = serialize($token); $broken = unserialize($s); var_dump($token->role2); var_dump($broken->role2); exit;

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.0090.00618.97
8.3.30.0070.00719.04
8.3.20.0090.00020.41
8.3.10.0040.00421.94
8.3.00.0080.00019.38
8.2.170.0090.00622.96
8.2.160.0110.00322.25
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00319.66
8.2.110.0030.00721.02
8.2.100.0090.00318.03
8.2.90.0040.00418.22
8.2.80.0040.00419.87
8.2.70.0040.00418.05
8.2.60.0060.00318.04
8.2.50.0000.01018.10
8.2.40.0080.00020.59
8.2.30.0000.00818.06
8.2.20.0050.00317.84
8.2.10.0080.00018.26
8.2.00.0050.00317.66
8.1.270.0040.00423.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0180.00424.02
8.1.230.0120.00022.82
8.1.220.0050.00517.79
8.1.210.0050.00318.79
8.1.200.0040.00417.36
8.1.190.0060.00317.23
8.1.180.0080.00018.10
8.1.170.0040.00418.65
8.1.160.0040.00422.22
8.1.150.0040.00418.93
8.1.140.0070.00017.40
8.1.130.0040.00417.96
8.1.120.0000.00717.45
8.1.110.0040.00417.53
8.1.100.0000.00717.34
8.1.90.0070.00017.51
8.1.80.0030.00417.46
8.1.70.0040.00417.47
8.1.60.0000.00817.64
8.1.50.0030.00517.60
8.1.40.0040.00417.52
8.1.30.0080.00017.69
8.1.20.0030.00517.63
8.1.10.0000.00817.55
8.1.00.0030.00617.41
8.0.300.0000.00820.03
8.0.290.0040.00416.88
8.0.280.0070.00018.48
8.0.270.0070.00017.98
8.0.260.0070.00017.28
8.0.250.0000.00816.97
8.0.240.0030.00317.00
8.0.230.0040.00417.11
8.0.220.0030.00316.88
8.0.210.0030.00416.93
8.0.200.0070.00017.04
8.0.190.0050.00217.09
8.0.180.0040.00417.00
8.0.170.0000.00816.92
8.0.160.0030.00317.03
8.0.150.0050.00216.98
8.0.140.0000.00716.95
8.0.130.0000.00713.46
8.0.120.0050.00316.97
8.0.110.0000.00716.95
8.0.100.0070.00016.79
8.0.90.0040.00416.94
8.0.80.0100.01116.97
8.0.70.0080.00016.87
8.0.60.0000.00816.94
8.0.50.0040.00416.88
8.0.30.0090.01117.22
8.0.20.0140.00617.45
8.0.10.0050.00316.93
8.0.00.0080.00816.92
7.4.330.0060.00015.15
7.4.320.0000.00716.44
7.4.300.0070.00016.68
7.4.290.0000.00716.48
7.4.280.0000.00816.58
7.4.270.0030.00316.43
7.4.260.0050.00216.62
7.4.250.0030.00516.51
7.4.240.0020.00516.49
7.4.230.0040.00416.62
7.4.220.0040.01316.61
7.4.210.0090.00716.56
7.4.200.0000.00716.71
7.4.160.0060.00916.50
7.4.150.0110.00717.40
7.4.140.0080.01017.86
7.4.130.0120.00516.45
7.4.120.0090.00716.55
7.4.110.0060.01216.51
7.4.100.0110.01116.68
7.4.90.0150.00416.71
7.4.80.0080.01319.39
7.4.70.0070.01416.46
7.4.60.0060.01216.52
7.4.50.0020.00216.66
7.4.40.0090.00916.65
7.4.30.0060.01016.68
7.4.10.0030.01514.78
7.4.00.0110.00614.98
7.3.330.0030.00313.54
7.3.320.0090.00513.32
7.3.310.0040.00416.52
7.3.300.0000.00716.48
7.3.290.0000.00716.36
7.3.280.0080.00916.43
7.3.270.0200.02017.40
7.3.260.0070.01416.59
7.3.250.0100.01416.42
7.3.240.0110.01116.49
7.3.230.0060.01216.45
7.3.210.0100.00716.51
7.3.200.0110.01319.39
7.3.190.0090.00916.51
7.3.180.0060.00916.53
7.3.170.0140.00316.44
7.3.160.0060.01116.52
7.3.130.0060.01314.89
7.3.120.0120.00714.87
7.3.110.0100.00714.78
7.3.100.0080.01114.83
7.3.90.0080.00614.79
7.3.80.0050.00815.04
7.3.70.0050.01014.78
7.3.60.0030.01414.98
7.3.50.0060.01014.85
7.3.40.0060.00714.81
7.3.30.0040.01414.91
7.3.20.0080.00816.52
7.3.10.0050.00916.53
7.3.00.0050.00816.79
7.2.330.0130.00616.70
7.2.320.0100.01016.54
7.2.310.0150.00816.48
7.2.300.0160.00616.68
7.2.290.0070.01016.61
7.2.260.0070.01115.02
7.2.250.0070.00815.22
7.2.240.0110.00615.16
7.2.230.0040.01014.98
7.2.220.0030.01314.87
7.2.210.0050.01315.22
7.2.200.0060.00615.05
7.2.190.0050.00815.19
7.2.180.0070.00814.98
7.2.170.0050.00715.01
7.2.160.0060.01114.75
7.2.150.0110.00717.06
7.2.140.0030.00717.09
7.2.130.0060.00317.00
7.2.120.0030.00616.68
7.2.110.0000.01116.93
7.2.100.0040.00816.99
7.2.90.0000.01616.74
7.2.80.0130.00316.98
7.2.70.0100.00717.19
7.2.60.0060.00417.01
7.2.50.0000.01216.81
7.2.40.0030.00717.02
7.2.30.0000.01416.80
7.2.20.0060.00917.06
7.2.10.0000.01116.75
7.2.00.0070.00717.05
7.1.330.0010.01315.67
7.1.320.0000.01115.93
7.1.310.0060.01015.86
7.1.300.0090.00315.85
7.1.290.0070.00715.80
7.1.280.0030.01015.86
7.1.270.0040.00915.75
7.1.260.0060.00515.54
7.1.250.0090.00615.91
7.1.240.0060.00915.65
7.1.230.0120.00015.96
7.1.220.0040.01115.70
7.1.210.0070.00715.89
7.1.200.0080.00315.92
7.1.190.0070.00315.92
7.1.180.0000.01515.96
7.1.170.0030.00715.72
7.1.160.0090.00315.86
7.1.150.0070.00415.93
7.1.140.0040.00916.04
7.1.130.0030.00615.95
7.1.120.0030.00915.95
7.1.110.0000.00816.02
7.1.100.0070.01015.86
7.1.90.0070.00716.04
7.1.80.0040.01115.89
7.1.70.0020.01016.46
7.1.60.0050.01517.54
7.1.50.0080.00816.45
7.1.40.0040.01115.94
7.1.30.0040.01115.77
7.1.20.0080.00315.94
7.1.10.0100.00015.75
7.1.00.0050.04219.20
7.0.330.0030.01015.40
7.0.320.0060.00915.41
7.0.310.0030.01215.53
7.0.300.0110.00415.45
7.0.290.0030.01015.28
7.0.280.0030.00615.32
7.0.270.0000.01415.44
7.0.260.0040.01115.50
7.0.250.0100.00415.28
7.0.240.0030.01015.40
7.0.230.0030.01415.49
7.0.220.0040.01115.48
7.0.210.0060.00615.23
7.0.200.0120.00715.09
7.0.190.0070.01015.34
7.0.180.0030.01015.56
7.0.170.0030.00715.21
7.0.160.0080.00515.48
7.0.150.0000.00815.52
7.0.140.0040.03718.63
7.0.130.0110.00415.27
7.0.120.0060.00615.62
7.0.110.0030.00615.32
7.0.100.0000.01415.48
7.0.90.0040.01115.51
7.0.80.0000.01415.50
7.0.70.0080.00315.44
7.0.60.0020.03417.69
7.0.50.0030.02816.64
7.0.40.0100.03516.80
7.0.30.0120.04416.87
7.0.20.0200.04316.82
7.0.10.0150.03516.70
7.0.00.0140.02216.84
5.6.400.0000.01314.41
5.6.390.0030.01214.29
5.6.380.0000.01514.27
5.6.370.0030.01314.80
5.6.360.0060.00914.39
5.6.350.0040.00814.33
5.6.340.0030.00614.61
5.6.330.0030.01414.63
5.6.320.0040.00414.59
5.6.310.0090.00014.21
5.6.300.0110.00414.34
5.6.290.0000.01314.55
5.6.280.0050.04017.71
5.6.270.0060.00514.73
5.6.260.0030.01214.34
5.6.250.0080.00414.63
5.6.240.0030.00714.23
5.6.230.0030.01314.29
5.6.220.0060.00314.35
5.6.210.0050.03217.52
5.6.200.0050.03316.43
5.6.190.0130.02817.30
5.6.180.0100.03217.40
5.6.170.0230.03717.41
5.6.160.0070.02717.52
5.6.150.0050.04216.32
5.6.140.0070.04616.21
5.6.130.0070.02516.12
5.6.120.0090.03317.74
5.6.110.0080.04117.80
5.6.100.0090.03617.65
5.6.90.0070.04517.77
5.6.80.0060.03417.26
5.6.70.0170.03217.44
5.6.60.0070.00314.49
5.6.50.0030.01214.02
5.6.40.0080.00414.35
5.6.30.0040.01214.11
5.6.20.0100.00314.42
5.6.10.0000.01314.58
5.6.00.0060.00714.17
5.5.380.0030.00714.48
5.5.370.0060.00314.35
5.5.360.0040.01114.11
5.5.350.0070.04517.40
5.5.340.0120.03516.10
5.5.330.0050.04017.33
5.5.320.0060.02717.39
5.5.310.0210.02017.43
5.5.300.0050.03116.33
5.5.290.0050.04216.13
5.5.280.0050.02417.77
5.5.270.0080.02817.66
5.5.260.0070.03017.44
5.5.250.0060.02317.60
5.5.240.0150.03817.24
5.5.230.0110.00714.47
5.5.220.0030.01414.06
5.5.210.0000.01314.40
5.5.200.0060.01014.14
5.5.190.0080.00414.03
5.5.180.0050.00314.17
5.5.170.0030.01014.35
5.5.160.0030.00714.28
5.5.150.0040.01114.35
5.5.140.0030.00714.13
5.5.130.0100.00614.20
5.5.120.0080.00514.30
5.5.110.0030.01014.56
5.5.100.0000.01414.37
5.5.90.0080.00614.18
5.5.80.0070.01014.35
5.5.70.0110.00414.32
5.5.60.0030.00614.05
5.5.50.0000.01114.36
5.5.40.0070.00714.41
5.5.30.0030.01314.23
5.5.20.0070.00314.12
5.5.10.0100.00314.27
5.5.00.0040.00814.15
5.4.450.0330.03015.92
5.4.440.0500.02815.92
5.4.430.0560.03315.98
5.4.420.0510.03815.78
5.4.410.0440.03515.77
5.4.400.0110.02815.61
5.4.390.0100.03115.47
5.4.380.0040.03615.56
5.4.370.0170.02315.56
5.4.360.0130.03215.53
5.4.350.0120.02715.56
5.4.340.0110.02915.49
5.4.330.0040.00412.36
5.4.320.0100.03015.56
5.4.310.0130.02715.59
5.4.300.0070.03115.42
5.4.290.0100.02715.57
5.4.280.0030.04215.56
5.4.270.0100.03315.55
5.4.260.0050.03515.59
5.4.250.0150.03615.48
5.4.240.0100.03915.48
5.4.230.0130.02615.55
5.4.220.0080.03215.49
5.4.210.0100.02815.55
5.4.200.0120.02814.50
5.4.190.0090.02915.58
5.4.180.0130.02515.48
5.4.170.0100.03615.59
5.4.160.0100.02915.55
5.4.150.0100.02815.47
5.4.140.0120.02514.34
5.4.130.0050.03214.28
5.4.120.0120.02714.33
5.4.110.0070.02914.33
5.4.100.0070.03414.37
5.4.90.0170.02314.37
5.4.80.0080.03114.39
5.4.70.0160.02314.28
5.4.60.0120.03114.39
5.4.50.0100.03514.34
5.4.40.0080.03214.32
5.4.30.0080.02814.29
5.4.20.0140.02514.36
5.4.10.0070.03114.26
5.4.00.0100.02814.06
5.3.290.0070.06314.77
5.3.280.0200.04714.58
5.3.270.0130.05314.65
5.3.260.0130.05314.71
5.3.250.0170.05014.71
5.3.240.0100.05314.74
5.3.230.0170.05014.62
5.3.220.0130.05314.86
5.3.210.0130.05714.70
5.3.200.0230.04714.63
5.3.190.0300.03714.74
5.3.180.0070.05714.66
5.3.170.0100.05314.62
5.3.160.0130.05314.61
5.3.150.0170.04714.73
5.3.140.0130.05014.77
5.3.130.0100.05714.71
5.3.120.0030.06314.54
5.3.110.0100.05714.70
5.3.100.0200.06714.18
5.3.90.0170.05714.19
5.3.80.0170.05714.15
5.3.70.0270.06014.15
5.3.60.0130.05314.13
5.3.50.0200.04313.99
5.3.40.0230.04014.12
5.3.30.0170.04713.96
5.3.20.0100.05313.73
5.3.10.0100.05713.66
5.3.00.0200.05013.68
5.2.170.0070.05311.09
5.2.160.0230.03711.26
5.2.150.0170.05311.19
5.2.140.0170.06311.16
5.2.130.0200.05311.14
5.2.120.0170.04011.20
5.2.110.0100.04311.23
5.2.100.0200.04311.20
5.2.90.0070.04711.21
5.2.80.0100.05311.32
5.2.70.0200.03711.13
5.2.60.0130.04011.17
5.2.50.0200.05011.07
5.2.40.0230.04711.22
5.2.30.0170.03711.01
5.2.20.0030.04711.00
5.2.10.0130.04010.91
5.2.00.0100.04310.78
5.1.60.0070.03710.10
5.1.50.0070.03710.04
5.1.40.0100.04010.01
5.1.30.0130.03310.44
5.1.20.0130.03310.49
5.1.10.0130.03310.08
5.1.00.0100.04010.15
5.0.50.0070.0308.63
5.0.40.0070.0278.44
5.0.30.0070.0438.43
5.0.20.0100.0338.34
5.0.10.0070.0278.30
5.0.00.0070.0408.19
4.4.90.0000.0275.88
4.4.80.0070.0205.88
4.4.70.0130.0205.87
4.4.60.0030.0235.91
4.4.50.0130.0175.89
4.4.40.0070.0335.96
4.4.30.0030.0235.90
4.4.20.0100.0175.94
4.4.10.0070.0235.98
4.4.00.0070.0335.91
4.3.110.0030.0235.83
4.3.100.0030.0275.79
4.3.90.0030.0235.91
4.3.80.0030.0375.86
4.3.70.0030.0235.77
4.3.60.0030.0235.80
4.3.50.0030.0275.82
4.3.40.0000.0375.76
4.3.30.0030.0304.61
4.3.20.0070.0204.59
4.3.10.0000.0234.59
4.3.00.0170.0236.96

preferences:
46.88 ms | 400 KiB | 5 Q