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'); //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.60.0080.00818.56
8.3.50.0150.00322.02
8.3.40.0120.00318.85
8.3.30.0110.00419.17
8.3.20.0050.00220.21
8.3.10.0050.00323.71
8.3.00.0100.00019.50
8.2.180.0040.01118.41
8.2.170.0090.00622.96
8.2.160.0070.00720.39
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00422.26
8.2.110.0030.00722.25
8.2.100.0040.00717.91
8.2.90.0040.00419.30
8.2.80.0050.00318.05
8.2.70.0030.00617.63
8.2.60.0090.00018.04
8.2.50.0040.00418.07
8.2.40.0000.00818.35
8.2.30.0020.00518.14
8.2.20.0080.00017.73
8.2.10.0000.00817.79
8.2.00.0000.00717.62
8.1.280.0070.00725.92
8.1.270.0000.00923.86
8.1.260.0100.00026.35
8.1.250.0080.00328.09
8.1.240.0090.00023.79
8.1.230.0090.00319.27
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0090.00017.38
8.1.190.0090.00017.66
8.1.180.0030.00518.10
8.1.170.0040.00418.71
8.1.160.0000.00722.02
8.1.150.0000.00818.61
8.1.140.0070.00017.45
8.1.130.0040.00417.85
8.1.120.0030.00317.55
8.1.110.0000.00717.57
8.1.100.0040.00417.57
8.1.90.0040.00417.39
8.1.80.0000.00817.54
8.1.70.0000.00717.47
8.1.60.0050.00317.57
8.1.50.0040.00417.63
8.1.40.0080.00017.60
8.1.30.0030.00517.58
8.1.20.0080.00017.76
8.1.10.0040.00417.66
8.1.00.0040.00417.48
8.0.300.0040.00418.77
8.0.290.0070.00017.15
8.0.280.0030.00518.46
8.0.270.0030.00317.23
8.0.260.0000.00816.87
8.0.250.0030.00317.07
8.0.240.0080.00017.03
8.0.230.0080.00016.88
8.0.220.0040.00416.93
8.0.210.0050.00316.86
8.0.200.0060.00017.09
8.0.190.0000.00717.03
8.0.180.0050.00216.98
8.0.170.0000.00716.98
8.0.160.0040.00416.96
8.0.150.0000.00816.92
8.0.140.0030.00316.86
8.0.130.0040.00413.43
8.0.120.0030.00516.82
8.0.110.0080.00016.86
8.0.100.0050.00316.81
8.0.90.0000.00716.86
8.0.80.0100.01316.88
8.0.70.0000.00716.84
8.0.60.0040.00417.00
8.0.50.0050.00216.73
8.0.30.0070.01217.32
8.0.20.0100.01017.43
8.0.10.0000.00716.94
8.0.00.0070.01216.87
7.4.330.0000.00515.00
7.4.320.0030.00316.57
7.4.300.0030.00316.52
7.4.290.0030.00316.67
7.4.280.0000.00716.67
7.4.270.0030.00516.59
7.4.260.0000.01016.50
7.4.250.0050.00216.43
7.4.240.0030.00516.58
7.4.230.0030.00316.64
7.4.220.0130.01016.70
7.4.210.0090.00616.62
7.4.200.0000.00716.76
7.4.190.0030.00316.51
7.4.160.0080.00816.38
7.4.150.0130.00617.40
7.4.140.0100.00817.86
7.4.130.0100.00716.58
7.4.120.0130.00816.57
7.4.110.0120.00916.38
7.4.100.0120.00816.65
7.4.90.0110.00616.57
7.4.80.0030.02019.39
7.4.70.0160.00016.54
7.4.60.0120.00616.63
7.4.50.0030.00616.46
7.4.40.0100.00622.77
7.4.30.0070.01716.80
7.4.00.0090.00615.15
7.3.330.0050.00013.31
7.3.320.0050.00013.32
7.3.310.0070.00016.39
7.3.300.0030.00316.32
7.3.290.0140.00716.38
7.3.280.0040.01416.35
7.3.270.0090.00917.40
7.3.260.0080.01116.39
7.3.250.0070.01116.45
7.3.240.0100.01316.64
7.3.230.0130.00616.39
7.3.210.0150.00316.36
7.3.200.0150.00319.39
7.3.190.0090.00916.70
7.3.180.0080.00716.32
7.3.170.0070.01316.59
7.3.160.0140.00216.47
7.3.120.0080.00414.92
7.2.330.0070.01116.69
7.2.320.0060.01216.42
7.2.310.0100.00716.66
7.2.300.0170.00016.78
7.2.290.0110.00716.80
7.2.00.0040.01419.47
7.1.100.0000.01217.89
7.1.70.0060.00317.16
7.1.60.0090.00316.99
7.1.50.0030.02016.96
7.1.00.0030.07722.30
7.0.200.0000.01116.71
7.0.140.0000.08022.08
7.0.60.0030.04019.81
7.0.50.0070.07017.85
7.0.40.0070.04020.36
7.0.30.0370.03720.19
7.0.20.0200.04020.26
7.0.10.0230.03720.19
7.0.00.0100.08020.24
5.6.280.0000.07720.92
5.6.210.0100.05320.63
5.6.200.0030.04018.18
5.6.190.0000.05020.77
5.6.180.0070.08020.39
5.6.170.0330.03720.42
5.6.160.0100.06720.55
5.6.150.0000.06018.15
5.6.140.0030.08718.15
5.6.130.0030.04318.15
5.6.120.0000.08721.11
5.6.110.0100.08320.99
5.6.100.0070.05021.13
5.6.90.0000.07721.09
5.6.80.0030.07720.39
5.6.70.0330.07720.43
5.5.350.0130.07020.38
5.5.340.0130.05018.06
5.5.330.0100.07720.27
5.5.320.0070.08720.32
5.5.310.0400.07320.34
5.5.300.0030.04317.96
5.5.290.0070.05017.97
5.5.280.0030.05320.75
5.5.270.0100.08020.95
5.5.260.0070.06720.89
5.5.250.0230.06320.45
5.5.240.0100.04720.04
5.4.450.0030.03319.17
5.4.440.0730.05019.28
5.4.430.0530.05719.34
5.4.420.0670.05019.55
5.4.410.0670.05319.45
5.4.400.0530.05719.23
5.4.390.0770.06719.16
5.4.380.0200.05718.55
5.4.370.0270.05318.51
5.4.360.0170.05718.77
5.4.350.0100.06318.63
5.4.340.0230.05318.75
5.4.320.0050.04312.52
5.4.310.0060.05212.52
5.4.300.0080.04412.52
5.4.290.0030.04312.51
5.4.280.0100.04312.41
5.4.270.0070.03812.41
5.4.260.0080.03912.41
5.4.250.0040.04812.41
5.4.240.0060.04212.41
5.4.230.0060.03712.40
5.4.220.0090.03712.40
5.4.210.0100.03212.40
5.4.200.0090.03812.40
5.4.190.0040.04012.39
5.4.180.0060.03812.40
5.4.170.0200.04312.40
5.4.160.0160.04812.40
5.4.150.0210.04512.39
5.4.140.0190.04812.07
5.4.130.0220.04312.07
5.4.120.0200.05512.02
5.4.110.0140.04812.01
5.4.100.0200.04312.02
5.4.90.0190.05312.02
5.4.80.0180.04812.02
5.4.70.0420.08512.01
5.4.60.0210.04212.01
5.4.50.0220.04512.02
5.4.40.0510.14512.00
5.4.30.0250.05212.00
5.4.20.0240.08112.00
5.4.10.0780.05211.99
5.4.00.0440.08611.48
5.3.290.0020.04912.80
5.3.280.0080.04412.71
5.3.270.0260.07312.72
5.3.260.0350.09012.72
5.3.250.0280.08012.71
5.3.240.0290.09312.72
5.3.230.0410.08512.71
5.3.220.0320.09212.68
5.3.210.0330.08912.68
5.3.200.0150.04712.68
5.3.190.0140.04912.68
5.3.180.0330.08912.67
5.3.170.0150.05212.67
5.3.160.0240.04712.68
5.3.150.0250.04912.67
5.3.140.0450.09512.66
5.3.130.0350.09312.66
5.3.120.0380.09112.66
5.3.110.0320.09612.66
5.3.100.0340.10112.14
5.3.90.0170.04412.13
5.3.80.0430.08312.12
5.3.70.0180.04712.12
5.3.60.0210.04112.10
5.3.50.0270.04112.05
5.3.40.0190.04312.04
5.3.30.0300.05912.01
5.3.20.0210.03911.79
5.3.10.0180.04111.76
5.3.00.0140.04311.74
5.2.170.0150.0349.25
5.2.160.0130.0379.24
5.2.150.0180.0329.25
5.2.140.0110.0409.24
5.2.130.0280.0669.21
5.2.120.0220.0409.20
5.2.110.0150.0409.21
5.2.100.0280.0579.21
5.2.90.0160.0319.21
5.2.80.0130.0359.19
5.2.70.0110.0409.19
5.2.60.0180.0339.14
5.2.50.0130.0369.11
5.2.40.0160.0339.09
5.2.30.0120.0369.07
5.2.20.0100.0389.07
5.2.10.0130.0348.97
5.2.00.0130.0338.83
5.1.60.0150.0268.11
5.1.50.0200.0298.11
5.1.40.0110.0308.10
5.1.30.0120.0318.45
5.1.20.0100.0348.47
5.1.10.0150.0388.19
5.1.00.0110.0338.18
5.0.50.0150.0246.67
5.0.40.0120.0286.52
5.0.30.0120.0416.34
5.0.20.0150.0226.30
5.0.10.0100.0266.29
5.0.00.0100.0376.27
4.4.90.0100.0184.78
4.4.80.0100.0194.76
4.4.70.0120.0184.75
4.4.60.0120.0164.76
4.4.50.0110.0164.77
4.4.40.0140.0554.71
4.4.30.0060.0224.76
4.4.20.0080.0184.85
4.4.10.0100.0184.85
4.4.00.0090.0374.76
4.3.110.0070.0234.67
4.3.100.0090.0224.67
4.3.90.0070.0184.63
4.3.80.0080.0294.59
4.3.70.0110.0224.63
4.3.60.0120.0214.63
4.3.50.0080.0184.63
4.3.40.0070.0284.54
4.3.30.0070.0243.30
4.3.20.0070.0213.29
4.3.10.0040.0253.25
4.3.00.0070.01715.59

preferences:
38.87 ms | 400 KiB | 5 Q