3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Permission implements \Serializable { protected $id = 3; public function serialize() { return serialize(array($this->id)); } public function unserialize($serialized) { list($this->id) = unserialize($serialized); } } class UserPermission implements \Serializable { public $permission; public $webshop; public function serialize() { return serialize(array($this->webshop, $this->permission)); } public function unserialize($serialized) { list($this->webshop, $this->permission) = unserialize($serialized); } } class Webshop implements \Serializable { protected $id = 13; public function serialize() { return serialize(array($this->id)); } public function unserialize($serialized) { list($this->id) = unserialize($serialized); } } class AbstractToken implements \Serializable { public $roles; public function serialize() { return serialize(array($this->roles)); } public function unserialize($serialized) { list($this->roles) = unserialize($serialized); } } class UsernamePasswordToken extends AbstractToken { private $credentials = null; private $providerKey = null; public function serialize() { return serialize(array($this->credentials, $this->providerKey, parent::serialize())); } public function unserialize($str) { list($this->credentials, $this->providerKey, $parentStr) = unserialize($str); parent::unserialize($parentStr); } } $token = new UsernamePasswordToken(); $webshop = new Webshop; $permission = new Permission; $roles = array(); for ($i = 0; $i < 2; $i++) { $roles[$i] = new UserPermission(); $roles[$i]->webshop = $webshop; $roles[$i]->permission = $permission; } $token->roles = $roles; var_dump(unserialize(serialize($token)));

Here you find the average performance (time & memory) of each version. A greyed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.2.00.0120.01219.56
7.1.90.0040.01118.20
7.1.80.3480.00917.02
7.1.70.3300.00916.89
7.1.60.2450.01528.76
7.1.50.2300.01028.63
7.1.40.1560.00828.39
7.1.30.1740.01028.42
7.1.20.1710.01528.41
7.1.10.0950.00916.55
7.1.00.0810.01316.45
7.0.230.0070.00717.78
7.0.220.0030.00917.80
7.0.210.0000.01416.77
7.0.200.2900.01016.43
7.0.190.2800.00916.59
7.0.180.1400.01116.25
7.0.170.1820.00916.29
7.0.160.1840.01216.22
7.0.150.0870.00716.20
7.0.140.0870.00816.24
7.0.130.0710.00916.39
7.0.120.0100.00916.41
7.0.110.0860.01216.35
7.0.100.0830.01016.37
7.0.90.0800.01316.15
7.0.80.0990.01016.36
7.0.70.1000.00816.22
7.0.60.0740.00916.13
7.0.50.0880.01016.32
7.0.40.0760.00816.32
7.0.30.0710.00816.31
7.0.20.0700.00716.22
7.0.10.0600.01016.30
7.0.00.0710.00916.26
hhvm-3.21.00.0800.17791.33
hhvm-3.20.20.0660.21391.00
hhvm-3.19.20.0810.21590.61
hhvm-3.18.40.0820.18888.89
hhvm-3.17.30.0730.14988.87
hhvm-3.15.40.0530.13971.62
hhvm-3.13.20.0570.18997.23
hhvm-3.12.140.0600.12775.37
hhvm-3.11.10.0790.16388.15
hhvm-3.10.10.0700.11873.53
5.6.300.0190.04620.75
5.6.290.0140.06420.67
5.6.280.0090.06520.81
5.6.270.0100.05920.93
5.6.260.0170.07320.91
5.6.250.0080.06520.88
5.6.240.0100.06620.90
5.6.230.0120.06220.88
5.6.220.0150.05820.88
5.6.210.0170.05921.04
5.6.200.0140.05320.86
5.6.190.0130.06120.89
5.6.180.0120.06720.89
5.6.170.0110.06020.80
5.6.160.0100.06120.97
5.6.150.0120.05820.79
5.6.140.0120.06320.89
5.6.130.0220.05720.88
5.6.120.0100.06120.80
5.6.110.0160.06120.91
5.6.100.0120.07120.84
5.6.90.0160.05320.82
5.6.80.0170.05620.17
5.6.70.0090.05720.23
5.6.60.0130.06020.26
5.6.50.0080.05420.25
5.6.40.0150.05220.34
5.6.30.0090.05620.27
5.6.20.0110.05720.29
5.6.10.0150.05420.21
5.6.00.0140.05420.21
5.5.380.0070.06517.61
5.5.370.0180.05917.68
5.5.360.0080.06617.64
5.5.350.0080.05917.63
5.5.340.0090.05818.05
5.5.330.0090.06218.01
5.5.320.0130.05217.95
5.5.310.0040.06818.05
5.5.300.0120.06617.92
5.5.290.0130.07718.00
5.5.280.0090.07118.03
5.5.270.0120.06818.07
5.5.260.0120.05718.00
5.5.250.0080.06217.83
5.5.240.0090.05517.56
5.5.230.0100.06417.57
5.5.220.0120.05917.46
5.5.210.0080.04817.58
5.5.200.0080.05617.43
5.5.190.0120.05417.45
5.5.180.0100.05517.57
5.5.160.0100.06317.55
5.5.150.0080.06817.56
5.5.140.0110.06017.48
5.5.130.0080.05117.58
5.5.120.0110.05217.53
5.5.110.0120.06117.55
5.5.100.0120.05417.39
5.5.90.0150.05717.36
5.5.80.0050.05817.46
5.5.70.0120.05417.34
5.5.60.0060.05617.45
5.5.50.0090.05117.50
5.5.40.0100.05017.39
5.5.30.0070.06417.48
5.5.20.0030.05917.46
5.5.10.0130.05217.43
5.5.00.0090.07117.39
5.4.450.0120.06519.33
5.4.440.0140.05719.29
5.4.430.0070.06219.29
5.4.420.0120.07219.22
5.4.410.0120.05719.22
5.4.400.0090.05319.03
5.4.390.0170.04819.00
5.4.380.0110.05219.02
5.4.370.0100.04819.05
5.4.360.0120.04619.08
5.4.350.0080.05319.00
5.4.340.0160.04718.93
5.4.320.0190.05218.99
5.4.310.0050.05718.92
5.4.300.0100.05418.90
5.4.290.0110.05019.06
5.4.280.0130.05118.94
5.4.270.0090.05118.88
5.4.260.0120.05518.98
5.4.250.0110.05018.95
5.4.240.0100.05518.94
5.4.230.0080.05318.93
5.4.220.0080.06019.00
5.4.210.0100.05518.92
5.4.200.0070.06018.98
5.4.190.0200.04818.97
5.4.180.0120.04918.92
5.4.170.0110.06018.97
5.4.160.0140.04918.84
5.4.150.0110.05418.91
5.4.140.0100.05317.08
5.4.130.0140.04817.01
5.4.120.0110.04817.05
5.4.110.0150.04217.04
5.4.100.0080.05216.97
5.4.90.0120.04816.91
5.4.80.0100.05417.02
5.4.70.0090.04716.99
5.4.60.0170.05116.94
5.4.50.0090.05916.99
5.4.40.0090.05017.00
5.4.30.0080.04816.97
5.4.20.0090.05017.00
5.4.10.0030.05916.95
5.4.00.0110.04916.68
5.3.290.0110.05415.86
5.3.280.0100.05615.89
5.3.270.0050.06715.79
5.3.260.0090.05915.84
5.3.250.0130.05215.84
5.3.240.0100.05315.79
5.3.230.0080.06715.93
5.3.220.0170.05415.86
5.3.210.0110.04715.75
5.3.200.0140.05415.83
5.3.190.0140.04915.77
5.3.180.0100.05315.80
5.3.170.0110.05315.82
5.3.160.0130.06015.86
5.3.150.0120.05915.78
5.3.140.0100.04615.88
5.3.130.0120.05015.78
5.3.120.0130.05315.76
5.3.110.0110.06215.87
5.3.100.0140.04715.51
5.3.90.0070.04715.36
5.3.80.0100.04515.42
5.3.70.0050.05715.48
5.3.60.0080.04715.42
5.3.50.0110.04715.30
5.3.40.0120.06015.50
5.3.30.0110.06115.47
5.3.20.0090.06515.24
5.3.10.0090.05015.16
5.3.00.0100.05815.28
5.2.170.0080.04713.46
5.2.160.0080.05013.56
5.2.150.0080.04213.54
5.2.140.0090.04613.52
5.2.130.0100.03613.55
5.2.120.0060.04713.43
5.2.110.0060.03813.55
5.2.100.0080.04013.54
5.2.90.0060.05013.46
5.2.80.0070.05013.46
5.2.70.0080.04213.50
5.2.60.0060.05213.37
5.2.50.0070.03813.47
5.2.40.0090.04713.30
5.2.30.0030.04113.48
5.2.20.0090.03913.50
5.2.10.0150.03713.24
5.2.00.0060.04113.21
5.1.60.0070.03312.77
5.1.50.0040.04012.67
5.1.40.0120.03812.81
5.1.30.0090.03212.97
5.1.20.0140.04313.01
5.1.10.0090.03612.83
5.1.00.0070.03812.84
5.0.50.0110.03611.74
5.0.40.0050.02511.67
5.0.30.0060.04911.60
5.0.20.0060.02711.57
5.0.10.0100.02711.61
5.0.00.0050.04911.61
4.4.90.0050.02510.47
4.4.80.0030.02810.47
4.4.70.0060.02110.47
4.4.60.0040.02410.47
4.4.50.0050.02410.47
4.4.40.0060.03510.47
4.4.30.0020.02610.47
4.4.20.0020.02810.47
4.4.10.0090.02610.47
4.4.00.0050.03710.47
4.3.110.0020.02310.47
4.3.100.0050.01910.47
4.3.90.0090.01410.47
4.3.80.0050.03110.47
4.3.70.0050.02210.47
4.3.60.0030.02510.47
4.3.50.0070.02010.47
4.3.40.0100.03210.47
4.3.30.0040.02810.47
4.3.20.0030.02510.47
4.3.10.0040.02310.47
4.3.00.0040.02310.47