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; } } class D extends \ReflectionClass { } $a = new A('a'); $b = new B('b'); $c = new C('c'); $d = new D('stdClass'); $serializedA = serialize($a); $serializedB = serialize($b); $serializedC = serialize($c); $serializedD = serialize($d); var_dump($serializedA); var_dump($serializedB); var_dump($serializedC); var_dump($serializedD); var_dump(unserialize($serializedD));

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.00619.09
8.3.30.0030.01019.05
8.3.20.0040.00420.30
8.3.10.0080.00022.10
8.3.00.0000.00720.61
8.2.170.0140.00322.96
8.2.160.0040.01119.16
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0100.01026.16
8.2.120.0040.00419.48
8.2.110.0030.00720.90
8.2.100.0110.00417.97
8.2.90.0030.00619.30
8.2.80.0050.00317.97
8.2.70.0030.00617.49
8.2.60.0050.00318.03
8.2.50.0000.00918.10
8.2.40.0000.00820.42
8.2.30.0000.00718.20
8.2.20.0040.00417.76
8.2.10.0030.00617.89
8.2.00.0090.00017.84
8.1.270.0000.00822.00
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.88
8.1.230.0090.00317.83
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0090.00017.35
8.1.190.0060.00317.23
8.1.180.0080.00018.10
8.1.170.0090.00018.71
8.1.160.0050.00222.23
8.1.150.0040.00418.59
8.1.140.0070.00017.41
8.1.130.0000.00717.84
8.1.120.0030.00317.43
8.1.110.0050.00317.56
8.1.100.0000.00717.55
8.1.90.0000.00717.41
8.1.80.0050.00217.43
8.1.70.0040.00417.45
8.1.60.0040.00417.59
8.1.50.0030.00517.55
8.1.40.0040.00417.53
8.1.30.0040.00417.57
8.1.20.0040.00417.71
8.1.10.0000.00817.56
8.1.00.0000.00917.55
8.0.300.0000.00818.77
8.0.290.0050.00316.88
8.0.280.0040.00418.41
8.0.270.0070.00017.31
8.0.260.0070.00016.92
8.0.250.0070.00017.11
8.0.240.0030.00517.09
8.0.230.0040.00417.04
8.0.220.0070.00017.03
8.0.210.0070.00017.02
8.0.200.0070.00016.94
8.0.190.0050.00317.07
8.0.180.0040.00417.00
8.0.170.0000.00817.00
8.0.160.0000.00716.86
8.0.150.0030.00316.99
8.0.140.0040.00417.00
8.0.130.0030.00313.40
8.0.120.0060.00316.96
8.0.110.0070.00016.92
8.0.100.0030.00517.05
8.0.90.0080.00017.07
8.0.80.0100.00717.05
8.0.70.0000.00817.01
8.0.60.0000.00716.88
8.0.50.0000.00717.04
8.0.30.0050.01417.25
8.0.20.0110.00717.42
8.0.10.0040.00417.08
8.0.00.0100.00916.85
7.4.330.0020.00215.01
7.4.320.0070.00016.64
7.4.300.0030.00316.64
7.4.290.0000.00716.56
7.4.280.0000.00716.46
7.4.270.0040.00416.55
7.4.260.0060.00013.34
7.4.250.0040.00416.62
7.4.240.0060.00216.48
7.4.230.0030.00316.77
7.4.220.0080.01516.57
7.4.210.0110.00516.60
7.4.200.0000.00716.68
7.4.190.0030.00316.65
7.4.160.0100.00616.46
7.4.150.0120.00617.40
7.4.140.0160.00417.86
7.4.130.0080.01316.53
7.4.120.0130.00416.61
7.4.110.0070.01416.66
7.4.100.0120.00616.70
7.4.90.0070.01116.72
7.4.80.0030.01519.39
7.4.70.0110.00716.47
7.4.60.0050.01116.64
7.4.50.0060.00316.75
7.4.40.0000.01622.77
7.4.30.0100.00716.44
7.4.10.0100.00715.22
7.4.00.0090.00814.97
7.3.330.0030.00313.17
7.3.320.0050.00013.36
7.3.310.0070.00016.46
7.3.300.0000.00716.28
7.3.290.0000.01416.37
7.3.280.0070.00916.29
7.3.270.0090.00917.40
7.3.260.0150.00516.68
7.3.250.0090.00816.34
7.3.240.0120.00616.51
7.3.230.0170.00716.60
7.3.210.0150.00316.39
7.3.200.0120.00919.39
7.3.190.0100.01316.70
7.3.180.0110.00716.38
7.3.170.0080.00816.38
7.3.160.0030.01316.50
7.3.130.0030.01614.77
7.3.120.0080.01014.73
7.3.110.0030.01514.57
7.3.100.0150.00614.84
7.3.90.0000.01315.02
7.3.80.0120.00414.65
7.3.70.0100.00314.87
7.3.60.0060.00914.95
7.3.50.0090.00314.98
7.3.40.0040.00814.95
7.3.30.0090.00614.70
7.3.20.0000.01216.59
7.3.10.0060.00716.64
7.3.00.0060.00816.45
7.2.330.0100.01016.78
7.2.320.0070.01416.75
7.2.310.0070.01016.65
7.2.300.0060.01116.58
7.2.290.0100.00616.53
7.2.260.0110.00715.34
7.2.250.0070.01015.08
7.2.240.0040.01115.32
7.2.230.0040.01515.38
7.2.220.0030.01415.13
7.2.210.0000.01815.05
7.2.200.0090.00414.76
7.2.190.0000.01315.04
7.2.180.0060.00615.24
7.2.170.0070.00715.23
7.2.160.0030.01014.98
7.2.150.0000.01416.89
7.2.140.0000.01316.94
7.2.130.0090.00516.89
7.2.120.0050.00816.67
7.2.110.0070.00816.67
7.2.100.0020.01017.03
7.2.90.0060.00516.96
7.2.80.0080.00316.97
7.2.70.0080.00616.82
7.2.60.0000.01416.94
7.2.50.0090.00416.87
7.2.40.0060.00917.14
7.2.30.0010.01016.84
7.2.20.0020.00917.06
7.2.10.0100.00716.90
7.2.00.0000.00916.95
7.1.330.0060.00615.73
7.1.320.0100.00315.54
7.1.310.0070.00716.03
7.1.300.0070.00715.69
7.1.290.0060.00315.79
7.1.280.0040.01115.79
7.1.270.0090.00015.76
7.1.260.0070.00715.48
7.1.250.0070.00715.74
7.1.240.0030.01016.03
7.1.230.0050.00515.52
7.1.220.0130.00015.70
7.1.210.0060.00315.83
7.1.200.0070.00715.96
7.1.190.0030.01315.81
7.1.180.0030.01015.76
7.1.170.0100.00715.57
7.1.160.0060.00915.70
7.1.150.0070.00415.67
7.1.140.0070.00715.98
7.1.130.0030.01015.90
7.1.120.0130.00015.75
7.1.110.0060.00615.97
7.1.100.0070.00415.86
7.1.90.0050.00315.92
7.1.80.0030.01015.75
7.1.70.0060.00616.35
7.1.60.0110.00217.84
7.1.50.0050.00816.33
7.1.40.0000.01415.69
7.1.30.0050.00515.51
7.1.20.0070.00715.50
7.1.10.0060.00615.72
7.1.00.0070.03919.05
7.0.330.0000.01315.21
7.0.320.0080.00015.37
7.0.310.0060.00315.12
7.0.300.0100.00715.22
7.0.290.0000.00815.11
7.0.280.0110.00415.09
7.0.270.0030.00615.40
7.0.260.0060.00615.31
7.0.250.0000.01115.55
7.0.240.0000.01315.34
7.0.230.0000.00815.32
7.0.220.0000.01115.41
7.0.210.0070.00715.40
7.0.200.0030.00816.00
7.0.190.0060.01015.54
7.0.180.0100.00615.17
7.0.170.0090.00615.18
7.0.160.0080.00015.51
7.0.150.0040.00815.18
7.0.140.0080.03418.71
7.0.130.0040.00715.44
7.0.120.0090.00015.24
7.0.110.0090.00315.45
7.0.100.0120.00015.48
7.0.90.0060.00915.44
7.0.80.0120.02917.72
7.0.70.0400.04217.68
7.0.60.0280.04517.69
7.0.50.0140.04317.87
7.0.40.0050.03316.76
7.0.30.0080.02916.81
7.0.20.0050.03816.79
7.0.10.0050.04216.80
7.0.00.0080.04616.86
5.6.400.0060.00614.59
5.6.390.0000.01114.48
5.6.380.0070.00714.53
5.6.370.0030.00614.47
5.6.360.0000.00814.36
5.6.350.0040.01114.77
5.6.340.0100.00314.36
5.6.330.0070.00714.43
5.6.320.0060.00914.40
5.6.310.0070.00714.04
5.6.300.0030.01214.58
5.6.290.0030.00914.27
5.6.280.0030.04017.82
5.6.270.0000.01114.55
5.6.260.0030.00914.27
5.6.250.0000.01314.67
5.6.240.0060.00914.50
5.6.230.0030.04817.54
5.6.220.0080.02317.37
5.6.210.0120.02917.47
5.6.200.0080.04417.93
5.6.190.0160.03517.76
5.6.180.0080.04217.84
5.6.170.0070.04517.79
5.6.160.0020.04917.71
5.6.150.0070.03017.84
5.6.140.0080.04717.79
5.6.130.0110.04117.71
5.6.120.0070.02217.88
5.6.110.0080.04617.69
5.6.100.0070.02717.73
5.6.90.0070.03117.68
5.6.80.0090.03417.28
5.6.70.0100.02917.27
5.6.60.0020.03417.41
5.6.50.0070.04217.45
5.6.40.0180.03317.29
5.6.30.0030.02817.44
5.6.20.0090.03917.30
5.6.10.0050.02917.40
5.6.00.0080.03317.39
5.5.380.0000.01414.33
5.5.370.0070.04217.52
5.5.360.0050.04017.27
5.5.350.0070.02417.30
5.5.340.0020.04017.66
5.5.330.0070.02817.39
5.5.320.0070.04117.48
5.5.310.0130.04017.59
5.5.300.0000.05617.58
5.5.290.0050.04717.56
5.5.280.0080.04517.50
5.5.270.0110.02517.50
5.5.260.0060.04417.68
5.5.250.0060.04717.48
5.5.240.0030.03017.21
5.5.230.0140.02417.41
5.5.220.0060.03317.31
5.5.210.0080.04017.16
5.5.200.0070.04217.10
5.5.190.0100.03817.30
5.5.180.0040.03117.25
5.5.170.0040.00814.45
5.5.160.0050.04317.21
5.5.150.0100.02517.29
5.5.140.0070.02417.07
5.5.130.0060.04317.15
5.5.120.0070.04517.16
5.5.110.0020.02617.30
5.5.100.0070.04317.04
5.5.90.0060.03517.08
5.5.80.0080.03617.11
5.5.70.0020.02717.25
5.5.60.0070.02217.09
5.5.50.0030.02517.23
5.5.40.0030.02317.11
5.5.30.0050.02316.99
5.5.20.0000.02517.15
5.5.10.0050.02317.19
5.5.00.0030.02417.09
5.4.450.0040.04815.70
5.4.440.0000.03015.84
5.4.430.0030.03815.82
5.4.420.0090.04215.77
5.4.410.0040.02915.67
5.4.400.0130.03815.61
5.4.390.0150.03515.71
5.4.380.0040.04415.62
5.4.370.0070.04015.61
5.4.360.0030.02715.61
5.4.350.0100.02115.67
5.4.340.0020.03015.70
5.4.330.0000.01012.19
5.4.320.0040.03615.54
5.4.310.0120.03215.65
5.4.300.0080.04015.66
5.4.290.0070.02215.52
5.4.280.0070.04415.67
5.4.270.0040.02915.67
5.4.260.0050.02115.71
5.4.250.0050.02015.63
5.4.240.0030.02515.60
5.4.230.0080.01315.52
5.4.220.0040.02015.61
5.4.210.0020.02215.51
5.4.200.0030.02315.61
5.4.190.0000.02715.66
5.4.180.0020.02315.64
5.4.170.0050.02715.65
5.4.160.0020.02315.65
5.4.150.0080.01515.61
5.4.140.0010.02414.33
5.4.130.0070.01814.34
5.4.120.0020.02214.29
5.4.110.0050.01914.38
5.4.100.0020.02314.28
5.4.90.0040.02114.28
5.4.80.0030.02114.35
5.4.70.0020.02314.36
5.4.60.0030.03614.32
5.4.50.0020.03814.24
5.4.40.0020.02214.36
5.4.30.0020.02214.36
5.4.20.0030.01814.36
5.4.10.0040.02414.32
5.4.00.0020.02014.01
5.3.290.0080.02413.48
5.3.280.0040.02013.42
5.3.270.0030.02813.42
5.3.260.0030.02213.43
5.3.250.0030.02113.48
5.3.240.0030.02813.48
5.3.230.0050.02713.41
5.3.220.0050.02213.43
5.3.210.0030.02113.37
5.3.200.0080.02513.40
5.3.190.0040.02213.47
5.3.180.0010.02113.38
5.3.170.0030.02213.38
5.3.160.0080.02813.40
5.3.150.0020.03913.46
5.3.140.0010.03213.44
5.3.130.0030.02013.37
5.3.120.0030.02113.42
5.3.110.0060.02613.35
5.3.100.0080.01713.19
5.3.90.0020.02013.18
5.3.80.0050.02213.12
5.3.70.0000.02513.15
5.3.60.0020.02113.13
5.3.50.0030.02213.16
5.3.40.0050.01513.09
5.3.30.0020.02113.10
5.3.20.0010.02412.99
5.3.10.0050.02112.95
5.3.00.0050.02012.92
5.2.170.0000.03311.68
5.2.160.0030.02711.68
5.2.150.0000.03011.68
5.2.140.0030.03011.68
5.2.130.0000.02711.68
5.2.120.0000.03311.68
5.2.110.0000.03711.68
5.2.100.0000.03011.68
5.2.90.0070.02311.68
5.2.80.0000.03011.68
5.2.70.0070.02711.68
5.2.60.0000.03311.68
5.2.50.0030.06011.68
5.2.40.0030.03011.68
5.2.30.0000.04711.68
5.2.20.0030.02711.68
5.2.10.0000.03711.68
5.2.00.0030.05011.68
5.1.60.0030.02311.68
5.1.50.0030.02011.68
5.1.40.0030.02311.68
5.1.30.0000.03711.68
5.1.20.0000.02311.68
5.1.10.0030.02711.68
5.1.00.0030.02311.68
5.0.50.0000.02011.68
5.0.40.0030.03311.68
5.0.30.0000.04011.68
5.0.20.0030.01711.68
5.0.10.0030.01711.68
5.0.00.0000.03011.68
4.4.90.0000.01711.68
4.4.80.0000.01711.68
4.4.70.0000.02011.68
4.4.60.0030.01311.68
4.4.50.0000.01311.68
4.4.40.0030.02311.68
4.4.30.0070.01011.68
4.4.20.0000.01311.68
4.4.10.0030.01311.68
4.4.00.0000.02311.68
4.3.110.0030.01311.68
4.3.100.0000.01311.68
4.3.90.0000.01311.68
4.3.80.0000.02311.68
4.3.70.0000.01311.68
4.3.60.0000.02011.68
4.3.50.0000.02011.68
4.3.40.0000.03311.68
4.3.30.0030.01711.68
4.3.20.0030.01311.68
4.3.10.0000.01711.68
4.3.00.0030.01311.68

preferences:
49.46 ms | 400 KiB | 5 Q