3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $a; private $b; public function __construct($a) { $this->a = $a; $this->b = $a; } public function __sleep() { return array('a', 'b'); } public function __wakeUp() { $this->__construct($this->a); } public function getA() { return $this->a; } public function getB() { return $this->b; } } class B implements \Serializable { private $a; private $b; public function __construct($a) { $this->a = $a; $this->b = $a; } public function serialize() { return serialize(array($this->a, $this->b)); } public function unserialize($serialized) { list($this->a, $this->b) = unserialize($serialized); $this->__construct($this->a); } public function getA() { return $this->a; } public function getB() { return $this->b; } } class C { private $a; private $b; public function __construct($a) { $this->a = $a; $this->b = $a; } public function getA() { return $this->a; } public function getB() { return $this->b; } } $a = new A('a'); $b = new B('b'); $c = new C('c'); $b->unserialize('bla'); $serializedA = serialize($a); $serializedB = serialize($b); $serializedC = serialize($c); var_dump($serializedA); var_dump($serializedB); var_dump($serializedC);

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.70.0090.00617.13
8.3.60.0120.00316.88
8.3.50.0050.01418.22
8.3.40.0120.00418.83
8.3.30.0120.00318.89
8.3.20.0040.00418.76
8.3.10.0090.00020.70
8.3.00.0080.00019.38
8.2.180.0120.00316.50
8.2.170.0070.01122.96
8.2.160.0000.01518.82
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0080.00019.95
8.2.110.0080.00319.21
8.2.100.0060.00617.91
8.2.90.0080.00018.25
8.2.80.0000.00819.27
8.2.70.0040.00417.50
8.2.60.0000.00818.16
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0050.00318.13
8.2.20.0000.00917.64
8.2.10.0040.00417.92
8.2.00.0040.00417.68
8.1.280.0070.01125.92
8.1.270.0040.00423.99
8.1.260.0070.00726.35
8.1.250.0060.00328.09
8.1.240.0030.00622.24
8.1.230.0080.00321.09
8.1.220.0060.00317.78
8.1.210.0000.00818.98
8.1.200.0090.00317.48
8.1.190.0050.00317.65
8.1.180.0000.00818.10
8.1.170.0040.00419.08
8.1.160.0070.00018.89
8.1.150.0050.00318.71
8.1.140.0050.00217.46
8.1.130.0000.00717.95
8.1.120.0030.00617.45
8.1.110.0050.00217.51
8.1.100.0080.00017.56
8.1.90.0070.00017.56
8.1.80.0040.00417.57
8.1.70.0030.00517.44
8.1.60.0040.00417.64
8.1.50.0050.00317.48
8.1.40.0040.00417.63
8.1.30.0030.00517.75
8.1.20.0030.00517.74
8.1.10.0060.00317.57
8.1.00.0000.00817.54
8.0.300.0060.00320.20
8.0.290.0040.00416.88
8.0.280.0070.00018.51
8.0.270.0000.00717.20
8.0.260.0070.00016.95
8.0.250.0030.00617.05
8.0.240.0020.00517.11
8.0.230.0030.00317.02
8.0.220.0000.00717.08
8.0.210.0040.00416.90
8.0.200.0030.00517.07
8.0.190.0060.00317.08
8.0.180.0040.00417.00
8.0.170.0060.00316.97
8.0.160.0090.00017.04
8.0.150.0030.00616.88
8.0.140.0030.00516.82
8.0.130.0060.00013.39
8.0.120.0080.00017.00
8.0.110.0020.00516.80
8.0.100.0060.00317.13
8.0.90.0070.00017.06
8.0.80.0090.00917.01
8.0.70.0000.00716.85
8.0.60.0000.00717.06
8.0.50.0040.00417.13
8.0.30.0130.00617.11
8.0.20.0100.01217.03
8.0.10.0070.00017.01
8.0.00.0130.00816.65
7.4.330.0030.00313.13
7.4.320.0030.00316.71
7.4.300.0060.00016.67
7.4.290.0000.00616.49
7.4.280.0030.00716.52
7.4.270.0000.00716.51
7.4.260.0060.00013.35
7.4.250.0060.00316.61
7.4.240.0070.00016.69
7.4.230.0000.00716.55
7.4.220.0040.01516.62
7.4.210.0030.01016.62
7.4.200.0000.00716.66
7.4.190.0020.00516.47
7.4.160.0130.00316.46
7.4.150.0130.00616.68
7.4.140.0090.00916.63
7.4.130.0090.00916.48
7.4.120.0000.01716.55
7.4.110.0060.01216.67
7.4.100.0070.01016.77
7.4.90.0030.01516.55
7.4.80.0130.01419.39
7.4.70.0100.00716.52
7.4.60.0130.00316.61
7.4.50.0000.00516.19
7.4.40.0070.00416.70
7.4.30.0030.01316.37
7.4.00.0070.00714.93
7.3.330.0000.00613.45
7.3.320.0030.00313.46
7.3.310.0070.00016.53
7.3.300.0000.00616.45
7.3.290.0060.00916.48
7.3.280.0050.01116.46
7.3.270.0150.00316.50
7.3.260.0120.01216.54
7.3.250.0140.00916.49
7.3.240.0130.00716.56
7.3.230.0150.00916.51
7.3.210.0100.00716.50
7.3.200.0080.00816.69
7.3.190.0100.00716.63
7.3.180.0060.01216.63
7.3.170.0000.01516.52
7.3.160.0100.01316.59
7.3.120.0100.00315.16
7.3.10.0090.01216.34
7.3.00.0110.00716.59
7.2.330.0060.01316.46
7.2.320.0140.01016.49
7.2.310.0090.00916.61
7.2.300.0110.00716.85
7.2.290.0090.00916.59
7.2.130.0170.00416.57
7.2.120.0090.00616.87
7.2.110.0070.00716.70
7.2.100.0150.00316.39
7.2.90.0110.00316.68
7.2.80.0090.00616.52
7.2.70.0090.00916.56
7.2.60.0070.00916.59
7.2.50.0110.00416.58
7.2.40.0140.00716.74
7.2.30.0140.01116.54
7.2.20.0130.01016.88
7.2.10.0150.00016.31
7.2.00.0100.00517.99
7.1.250.0030.01215.76
7.1.200.0030.00915.64
7.1.100.0040.00818.22
7.1.70.0000.00717.07
7.1.60.0030.00917.10
7.1.50.0110.01117.06
7.1.00.0000.07022.52
7.0.200.0040.01216.85
7.0.140.0030.07322.15
7.0.120.0070.07022.09
7.0.60.0130.07020.07
7.0.50.0030.08317.90
7.0.40.0100.08720.02
7.0.30.0270.07320.08
7.0.20.0270.05320.23
7.0.10.0100.09020.12
7.0.00.0170.05320.12
5.6.280.0100.06721.13
5.6.210.0000.04320.49
5.6.200.0100.07718.14
5.6.190.0070.04320.57
5.6.180.0370.07720.63
5.6.170.0170.04720.55
5.6.160.0030.05720.54
5.6.150.0100.07718.15
5.6.140.0070.08718.18
5.6.130.0130.08018.16
5.6.120.0200.07721.14
5.6.110.0170.07020.98
5.6.100.0030.04321.14
5.6.90.0070.07320.89
5.6.80.0170.05020.38
5.5.350.3870.03720.48
5.5.340.0100.07317.98
5.5.330.0070.04020.45
5.5.320.0100.04020.32
5.5.310.0270.05320.27
5.5.300.0030.04718.00
5.5.290.0070.05717.97
5.5.280.0070.08320.89
5.5.270.0100.08320.82
5.5.260.0100.08320.99
5.5.250.0070.07020.59
5.5.240.0230.08020.04
5.4.450.3600.04019.39
5.4.440.3530.04319.17
5.4.430.3670.03319.52
5.4.420.3430.04319.48
5.4.410.3600.03719.44
5.4.400.4000.04319.09
5.4.390.3600.04319.05
5.4.380.3200.04019.09
5.4.370.3870.04019.32
5.4.360.4300.03719.09
5.4.350.3570.04018.88
5.4.340.3300.03318.94
5.4.320.3230.04019.22
5.4.310.3600.03719.16
5.4.300.3330.04019.08
5.4.290.3330.03719.13
5.4.280.3930.04719.31
5.4.270.3500.04319.22
5.4.260.3230.03718.95
5.4.250.3270.03019.13
5.4.240.3700.03719.21
5.4.230.3870.03718.84
5.4.220.4130.04019.07
5.4.210.3370.03719.05
5.4.200.3700.03719.21
5.4.190.3600.03719.05
5.4.180.3170.03718.84
5.4.170.3630.04318.98
5.4.160.4270.03019.11
5.4.150.3570.04018.84
5.4.140.3600.04016.41
5.4.130.3330.03716.37
5.4.120.3500.04016.38
5.4.110.3470.03316.59
5.4.100.3900.03716.59
5.4.90.4230.03316.32
5.4.80.4200.03316.28
5.4.70.4200.03316.38
5.4.60.3970.03316.52
5.4.50.5270.04016.43
5.4.40.4330.03016.42
5.4.30.4000.03316.45
5.4.20.4230.04016.32
5.4.10.3770.03716.17
5.4.00.3870.03715.96
5.3.290.3100.04314.80
5.3.280.3830.03714.66
5.3.270.3700.04014.72
5.3.260.4200.04314.64
5.3.250.3370.03714.61
5.3.240.3330.03014.62
5.3.230.3770.03714.61
5.3.220.3830.03314.49
5.3.210.3500.04014.57
5.3.200.3930.02714.50
5.3.190.4300.03714.51
5.3.180.4330.03714.56
5.3.170.4300.03714.57
5.3.160.4330.04014.60
5.3.150.4230.04014.50
5.3.140.4230.04014.48
5.3.130.3930.04014.49
5.3.120.4100.03714.48
5.3.110.3930.03714.54
5.3.100.3570.03314.13
5.3.90.4100.03314.26
5.3.80.4330.03713.96
5.3.70.4400.03314.05
5.3.60.3730.04013.95
5.3.50.4230.03714.13
5.3.40.3400.04013.95
5.3.30.4230.03314.04
5.3.20.4330.03313.64
5.3.10.3770.04013.89
5.3.00.4170.03713.63
5.2.170.3370.03011.39
5.2.160.3300.03011.10
5.2.150.3900.03011.08
5.2.140.3200.03011.08
5.2.130.3230.03011.05
5.2.120.3370.03011.04
5.2.110.3100.02311.30
5.2.100.3470.02311.05
5.2.90.3400.02011.21
5.2.80.3370.02311.05
5.2.70.3400.02311.13
5.2.60.3400.03311.04
5.2.50.0000.04711.05
5.2.40.0030.06011.03
5.2.30.0100.05310.92
5.2.20.0070.04710.89
5.2.10.2970.03010.98
5.2.00.2870.02010.86
5.1.60.2770.02310.48
5.1.50.2430.03010.48
5.1.40.2500.03010.48
5.1.30.2600.01710.48
5.1.20.2530.02010.48
5.1.10.3030.03010.48
5.1.00.3000.02310.48
5.0.50.1370.02010.48
5.0.40.1700.01710.48
5.0.30.1700.03310.48
5.0.20.1670.02310.48
5.0.10.1400.02010.48
5.0.00.1300.03310.48
4.4.90.1500.01710.48
4.4.80.1300.02010.48
4.4.70.0000.03310.48
4.4.60.0030.03010.48
4.4.50.1630.01710.48
4.4.40.1270.02710.48
4.4.30.1600.01710.48
4.4.20.1330.01710.48
4.4.10.1630.01710.48
4.4.00.1300.02710.48
4.3.110.1070.01310.48
4.3.100.1300.01710.48
4.3.90.1730.01010.48
4.3.80.1700.02710.48
4.3.70.1600.02010.48
4.3.60.1500.01710.48
4.3.50.1700.01310.48
4.3.40.1700.02310.48
4.3.30.0800.01310.48
4.3.20.0830.02310.48
4.3.10.0900.02010.48
4.3.00.0730.02710.48

preferences:
40.84 ms | 401 KiB | 5 Q