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('C:1:"B":30:{a:2:{i:0;s:1:"b";i:1;s:1:"b";}}'); var_dump($b); $b->unserialize('C:1:"A":30:{a:2:{i:0;s:1:"b";i:1;s:1:"b";}}'); var_dump($b); $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.40.0110.00418.85
8.3.30.0030.01318.80
8.3.20.0040.00418.72
8.3.10.0080.00018.90
8.3.00.0150.00019.51
8.2.170.0090.00622.96
8.2.160.0080.00819.09
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00719.89
8.2.110.0050.00519.39
8.2.100.0060.00918.03
8.2.90.0060.00317.75
8.2.80.0000.00918.73
8.2.70.0000.00917.74
8.2.60.0030.00617.92
8.2.50.0000.00817.93
8.2.40.0060.00319.35
8.2.30.0090.00017.90
8.2.20.0040.00717.74
8.2.10.0080.00017.73
8.2.00.0050.00317.93
8.1.270.0060.00323.99
8.1.260.0030.00526.35
8.1.250.0000.00828.09
8.1.240.0000.01020.99
8.1.230.0040.00817.95
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00717.48
8.1.190.0030.00517.48
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0040.00419.12
8.1.150.0000.00718.57
8.1.140.0060.00317.55
8.1.130.0040.00417.50
8.1.120.0030.00517.54
8.1.110.0000.00817.41
8.1.100.0030.00317.39
8.1.90.0000.00817.40
8.1.80.0000.00717.43
8.1.70.0000.00717.40
8.1.60.0000.00817.63
8.1.50.0030.00517.60
8.1.40.0030.00617.52
8.1.30.0060.00317.71
8.1.20.0040.00417.67
8.1.10.0000.00817.66
8.1.00.0000.00717.56
8.0.300.0070.00018.77
8.0.290.0090.00016.88
8.0.280.0080.00018.74
8.0.270.0030.00317.37
8.0.260.0030.00316.94
8.0.250.0000.00717.11
8.0.240.0040.00417.09
8.0.230.0040.00417.03
8.0.220.0030.00517.01
8.0.210.0000.00817.00
8.0.200.0040.00417.00
8.0.190.0080.00017.05
8.0.180.0000.01117.07
8.0.170.0040.00417.02
8.0.160.0060.00316.91
8.0.150.0040.00416.85
8.0.140.0040.00416.85
8.0.130.0050.00213.48
8.0.120.0080.00316.91
8.0.110.0000.00716.96
8.0.100.0080.00017.07
8.0.90.0040.00417.05
8.0.80.0060.00917.06
8.0.70.0050.00317.08
8.0.60.0000.00816.96
8.0.50.0050.00517.04
8.0.30.0150.00617.30
8.0.20.0160.00217.14
8.0.10.0000.00717.18
8.0.00.0080.01016.73
7.4.330.0060.00013.06
7.4.320.0060.00016.58
7.4.300.0050.00216.59
7.4.290.0030.00316.55
7.4.280.0050.00316.46
7.4.270.0050.00316.64
7.4.260.0000.00613.30
7.4.250.0030.00616.54
7.4.240.0000.00716.71
7.4.230.0000.00816.47
7.4.220.0030.01216.65
7.4.210.0090.00616.52
7.4.200.0080.00016.42
7.4.190.0000.00816.51
7.4.160.0060.00916.68
7.4.150.0100.00716.58
7.4.140.0090.00917.86
7.4.130.0090.01016.46
7.4.120.0150.00316.76
7.4.110.0110.00716.68
7.4.100.0100.00716.70
7.4.90.0110.01116.36
7.4.80.0100.00619.39
7.4.70.0060.01216.63
7.4.60.0050.01116.63
7.4.50.0000.00916.50
7.4.40.0070.00316.64
7.4.30.0060.00916.45
7.4.10.0000.01814.96
7.4.00.0090.00815.15
7.3.330.0030.00313.32
7.3.320.0030.00313.25
7.3.310.0000.00716.45
7.3.300.0000.00716.33
7.3.290.0110.00716.47
7.3.280.0150.00616.44
7.3.270.0100.00716.43
7.3.260.0100.00716.66
7.3.240.0090.00916.41
7.3.230.0110.00716.63
7.3.210.0090.00916.53
7.3.200.0120.00616.53
7.3.190.0150.00416.45
7.3.180.0000.02216.52
7.3.170.0060.00916.50
7.3.160.0060.01016.64
7.3.130.0100.00714.57
7.3.120.0050.01214.77
7.3.110.0080.00814.64
7.3.100.0030.01014.43
7.3.90.0040.01114.80
7.3.80.0120.00314.72
7.3.70.0060.00314.75
7.3.60.0000.01114.37
7.3.50.0100.00714.65
7.3.40.0030.00614.53
7.3.30.0060.00914.66
7.3.20.0070.00716.27
7.3.10.0050.01016.42
7.3.00.0070.00516.37
7.2.330.0110.00716.38
7.2.320.0070.01016.44
7.2.310.0130.00616.45
7.2.300.0050.01116.82
7.2.290.0140.00316.59
7.2.260.0030.01414.66
7.2.250.0100.01015.04
7.2.240.0110.00414.72
7.2.230.0000.01214.94
7.2.220.0030.00714.86
7.2.210.0080.00815.13
7.2.200.0030.01214.81
7.2.190.0040.01115.14
7.2.180.0000.00915.02
7.2.170.0060.00915.00
7.2.160.0030.00614.61
7.2.150.0090.00316.79
7.2.140.0090.00616.59
7.2.130.0030.00916.77
7.2.120.0040.00917.07
7.2.110.0130.00916.79
7.2.100.0090.00616.72
7.2.90.0090.00616.62
7.2.80.0100.00816.71
7.2.70.0130.00216.82
7.2.60.0100.00516.94
7.2.50.0090.00716.93
7.2.40.0070.00916.96
7.2.30.0080.00616.84
7.2.20.0090.00716.87
7.2.10.0060.01016.91
7.2.00.0080.00617.50
7.1.330.0090.00615.31
7.1.320.0060.00915.47
7.1.310.0030.01315.90
7.1.300.0000.01015.70
7.1.290.0080.00415.74
7.1.280.0030.01315.25
7.1.270.0040.00415.56
7.1.260.0060.00915.59
7.1.250.0050.00515.63
7.1.240.0040.00815.54
7.1.230.0090.00915.82
7.1.220.0100.00315.83
7.1.210.0100.00315.51
7.1.200.0060.00715.77
7.1.190.0090.00815.66
7.1.180.0100.00315.59
7.1.170.0070.00715.46
7.1.160.0070.01015.81
7.1.150.0070.00515.56
7.1.140.0190.00715.82
7.1.130.0090.00515.72
7.1.120.0140.00615.84
7.1.110.0140.00415.93
7.1.100.0110.00616.45
7.1.90.0160.00215.66
7.1.80.0110.00215.40
7.1.70.0040.00916.22
7.1.60.0110.00616.92
7.1.50.0100.00916.08
7.1.40.0080.00615.69
7.1.30.0070.00715.71
7.1.20.0340.00815.70
7.1.10.0050.00715.51
7.1.00.0050.02517.98
7.0.330.0040.00715.37
7.0.320.0040.00414.84
7.0.310.0070.00715.46
7.0.300.0050.00815.13
7.0.290.0190.00515.36
7.0.280.0240.00215.19
7.0.270.0170.00915.19
7.0.260.0190.00515.15
7.0.250.0080.00515.41
7.0.240.0070.00615.38
7.0.230.0090.00515.22
7.0.220.0080.00915.19
7.0.210.0080.00515.38
7.0.200.0070.00315.85
7.0.190.0100.00215.22
7.0.180.0120.00415.27
7.0.170.0040.00915.42
7.0.160.0070.00415.06
7.0.150.0060.00615.33
7.0.140.0060.02717.55
7.0.130.0080.00515.19
7.0.120.0070.02817.60
7.0.110.0100.00415.27
7.0.100.0100.00515.17
7.0.90.0050.00615.21
7.0.80.0040.01115.34
7.0.70.0070.01015.44
7.0.60.0060.03216.80
7.0.50.0070.01716.26
7.0.40.0110.03215.48
7.0.30.0200.02515.54
7.0.20.0110.03515.51
7.0.10.0110.02115.70
7.0.00.0090.02815.61
5.6.400.0100.00414.17
5.6.390.0000.01113.96
5.6.380.0080.00614.46
5.6.370.0050.00914.18
5.6.360.0040.01014.39
5.6.350.0090.00814.17
5.6.340.0110.00214.37
5.6.330.0110.00314.30
5.6.320.0050.01014.71
5.6.310.0060.00714.43
5.6.300.0060.00814.46
5.6.290.0050.00914.34
5.6.280.0030.03116.44
5.6.270.0050.00914.41
5.6.260.0090.00414.48
5.6.250.0070.00814.39
5.6.240.0080.00614.51
5.6.230.0070.00914.48
5.6.220.0100.00614.21
5.6.210.0080.02916.57
5.6.200.0080.01815.67
5.6.190.0110.01816.39
5.6.180.0170.02516.27
5.6.170.0150.02116.30
5.6.160.0090.02116.21
5.6.150.0060.01815.48
5.6.140.0100.03015.53
5.6.130.0080.03215.65
5.6.120.0060.02616.60
5.6.110.0070.01816.66
5.6.100.0090.01916.52
5.6.90.0110.01516.47
5.6.80.0110.02916.18
5.6.70.0040.01114.09
5.6.60.0070.00713.98
5.6.50.0100.00514.14
5.6.40.0030.00914.35
5.6.30.0100.00714.40
5.6.20.0030.01114.18
5.6.10.0070.00614.16
5.6.00.0120.00314.17
5.5.380.0050.00413.51
5.5.370.0120.00313.54
5.5.360.0090.00113.65
5.5.350.0100.03015.82
5.5.340.0070.03115.04
5.5.330.0050.01915.80
5.5.320.0030.02515.83
5.5.310.0130.03015.87
5.5.300.0060.01514.98
5.5.290.0070.03115.04
5.5.280.0070.02316.00
5.5.270.0050.03116.01
5.5.260.0080.01816.00
5.5.250.0040.02416.01
5.5.240.0050.02715.69
5.5.230.0070.00813.38
5.5.220.0050.00913.64
5.5.210.0040.00813.52
5.5.200.0100.00613.62
5.5.190.0090.00613.60
5.5.180.0070.00813.60
5.5.170.0110.00314.14
5.5.160.0070.00713.57
5.5.150.0060.00513.42
5.5.140.0060.00513.40
5.5.130.0050.00713.55
5.5.120.0030.00913.42
5.5.110.0060.00713.48
5.5.100.0080.00713.43
5.5.90.0020.01013.49
5.5.80.0050.00713.49
5.5.70.0070.00613.46
5.5.60.0090.00513.52
5.5.50.0080.00313.55
5.5.40.0050.00813.59
5.5.30.0120.00213.70
5.5.20.0100.00313.41
5.5.10.0040.01013.54
5.5.00.0070.00613.49
5.4.450.0080.02814.59
5.4.440.0080.03014.54
5.4.430.0040.01814.61
5.4.420.0030.02614.64
5.4.410.0100.02314.59
5.4.400.0130.02214.44
5.4.390.0070.02914.54
5.4.380.0080.01814.46
5.4.370.0030.02314.45
5.4.360.0070.01414.53
5.4.350.0030.01914.43
5.4.340.0060.01914.48
5.4.330.0060.00412.22
5.4.320.0080.01814.47
5.4.310.0060.02814.50
5.4.300.0060.01714.56
5.4.290.0050.03014.43
5.4.280.0110.02414.53
5.4.270.0070.03114.53
5.4.260.0050.02114.52
5.4.250.0070.02414.50
5.4.240.0070.01314.43
5.4.230.0080.02914.54
5.4.220.0050.02814.43
5.4.210.0060.02914.50
5.4.200.0080.02614.51
5.4.190.0050.02014.52
5.4.180.0050.02614.53
5.4.170.0090.02314.53
5.4.160.0050.02314.52
5.4.150.0070.03014.45
5.4.140.0060.02013.64
5.4.130.0050.01713.62
5.4.120.0040.02013.59
5.4.110.0120.01813.65
5.4.100.0060.02913.64
5.4.90.0060.02613.65
5.4.80.0060.02713.59
5.4.70.0070.02113.65
5.4.60.0070.02513.57
5.4.50.0050.01613.61
5.4.40.0050.01713.60
5.4.30.0040.02513.65
5.4.20.0060.02813.62
5.4.10.0070.01613.62
5.4.00.0050.01613.44
5.3.290.0010.02013.06
5.3.280.0060.01413.04
5.3.270.0080.02613.02
5.3.260.0070.02913.02
5.3.250.0050.02513.03
5.3.240.0040.02513.04
5.3.230.0070.01613.02
5.3.220.0040.02512.97
5.3.210.0040.03013.02
5.3.200.0040.02113.02
5.3.190.0080.01813.03
5.3.180.0040.02913.02
5.3.170.0050.01413.03
5.3.160.0100.02012.97
5.3.150.0100.02012.98
5.3.140.0050.01513.00
5.3.130.0060.01513.01
5.3.120.0040.03113.02
5.3.110.0040.03112.98
5.3.100.0040.02612.83
5.3.90.0050.02112.85
5.3.80.0040.02812.84
5.3.70.0070.01612.81
5.3.60.0070.01512.86
5.3.50.0050.01512.79
5.3.40.0060.01412.81
5.3.30.0060.01912.80
5.3.20.0070.02212.72
5.3.10.0010.02612.71
5.3.00.0070.02812.67
5.2.170.0090.01712.06
5.2.160.0050.02111.96
5.2.150.0020.03611.93
5.2.140.0040.03011.96
5.2.130.0050.03111.96
5.2.120.0030.03511.92
5.2.110.0010.03111.96
5.2.100.0060.03411.96
5.2.90.0050.02912.00
5.2.80.0000.02211.96
5.2.70.0050.01711.94
5.2.60.0050.02011.94
5.2.50.0030.03411.94
5.2.40.0090.02811.87
5.2.30.0050.03011.93
5.2.20.0020.03311.96
5.2.10.0050.03011.84
5.2.00.0020.02211.84
5.1.60.0030.02511.40
5.1.50.0050.02711.44
5.1.40.0090.02811.38
5.1.30.0090.02511.65
5.1.20.0080.02011.57
5.1.10.0070.02911.47
5.1.00.0060.02111.40
5.0.50.0050.01810.67
5.0.40.0030.02510.64
5.0.30.0040.03410.47
5.0.20.0060.02110.51
5.0.10.0030.01710.51
5.0.00.0020.03510.58
4.4.90.0030.01010.28
4.4.80.0050.01010.28
4.4.70.0040.01110.28
4.4.60.0020.01210.28
4.4.50.0030.01110.28
4.4.40.0040.01310.28
4.4.30.0020.01210.28
4.4.20.0070.01710.28
4.4.10.0030.01710.28
4.4.00.0030.02210.28
4.3.110.0040.01910.28
4.3.100.0020.01410.28
4.3.90.0040.01710.28
4.3.80.0030.02510.28
4.3.70.0000.01310.28
4.3.60.0040.01910.28
4.3.50.0020.00910.28
4.3.40.0040.01210.28
4.3.30.0000.01110.28
4.3.20.0040.01810.28
4.3.10.0000.01810.28
4.3.00.0050.00910.28

preferences:
44.41 ms | 400 KiB | 5 Q