3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace bed { class A { private $id=5; protected $b; public $c; public function __sleep() { return ['id']; } } class B extends A{ public function __sleep(){ return parent::__sleep(); } } class D extends A{ public function __sleep(){ return ["\0bed\A\0id"]; } } class CoolD extends A { private $d; protected $e; public $f; public function __sleep(){ $allProperties = []; $reflection = new \ReflectionClass($this); do{ foreach ($reflection->getProperties() as $prop) { $allProperties[($prop->isPrivate() ? "\0" . $prop->getDeclaringClass()->getName() . "\0" . $prop->getName() : $prop->getName())] = true; } }while($reflection = $reflection->getParentClass()); return array_keys($allProperties); } } class C extends A{ } // var_dump(serialize(new C)); - not working // var_dump(serialize(new B)); - not working var_dump(serialize(new D)); var_dump(serialize(new CoolD)); }

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.5.10.0100.00916.73
8.5.00.0110.01220.14
8.4.150.0030.00014.05
8.4.140.0130.00817.65
8.4.130.0100.01117.54
8.4.120.0120.00820.60
8.4.110.0050.00322.51
8.4.100.0140.00617.94
8.4.90.0060.00320.57
8.4.80.0060.00219.05
8.4.70.0050.00519.08
8.4.60.0110.00918.82
8.4.50.0140.00720.46
8.4.40.0100.01019.64
8.4.30.0110.00922.36
8.4.20.0130.00324.21
8.4.10.0000.01017.62
8.3.280.0120.00818.44
8.3.270.0160.00616.55
8.3.260.0050.01116.78
8.3.250.0130.00620.73
8.3.240.0100.00816.57
8.3.230.0020.00616.70
8.3.220.0060.00119.16
8.3.210.0100.00818.61
8.3.200.0030.00616.69
8.3.190.0050.00317.21
8.3.180.0110.00816.73
8.3.170.0060.01017.22
8.3.160.0150.00318.59
8.3.150.0060.01316.98
8.3.140.0000.00817.16
8.3.130.0080.01218.33
8.3.120.0030.00618.21
8.3.110.0030.00616.88
8.3.100.0050.00316.63
8.3.90.0030.00618.52
8.3.80.0090.00317.97
8.3.70.0110.01118.68
8.3.60.0110.00718.30
8.3.50.0110.00817.37
8.3.40.0150.00318.70
8.3.30.0110.00418.56
8.3.20.0040.00421.89
8.3.10.0040.00421.53
8.3.00.0030.00523.70
8.2.290.0100.00916.71
8.2.280.0090.01018.67
8.2.270.0070.01117.18
8.2.260.0130.00616.55
8.2.250.0130.00916.81
8.2.240.0050.00518.82
8.2.230.0100.00020.94
8.2.220.0190.00024.06
8.2.210.0080.00026.77
8.2.200.0060.00318.41
8.2.190.0180.00416.75
8.2.180.0160.00316.75
8.2.170.0070.01119.00
8.2.160.0030.01322.96
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.72
8.2.110.0090.00922.23
8.2.100.0110.00017.77
8.2.90.0000.00817.91
8.2.80.0060.00317.97
8.2.70.0060.00318.05
8.2.60.0000.00817.97
8.2.50.0000.00818.10
8.2.40.0040.00420.59
8.2.30.0000.00719.26
8.2.20.0050.00318.07
8.2.10.0070.00019.45
8.2.00.0070.00019.25
8.1.330.0110.00822.11
8.1.320.0140.00717.97
8.1.310.0090.00918.50
8.1.300.0040.00718.08
8.1.290.0000.01118.88
8.1.280.0040.01125.92
8.1.270.0040.00422.14
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.01021.82
8.1.230.0040.00820.98
8.1.220.0050.00317.74
8.1.210.0050.00318.99
8.1.200.0040.00817.38
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0030.00518.47
8.1.160.0000.00718.98
8.1.150.0080.00018.93
8.1.140.0000.00718.93
8.1.130.0060.00320.17
8.1.120.0000.01017.51
8.1.110.0040.00417.47
8.1.100.0040.00417.39
8.1.90.0030.00617.48
8.1.80.0040.00417.29
8.1.70.0000.00817.37
8.1.60.0090.00017.63
8.1.50.0040.00417.57
8.1.40.0060.00317.51
8.1.30.0090.00017.70
8.1.20.0070.00317.71
8.1.10.0030.00617.57
8.1.00.0040.00417.50
8.0.300.0000.00819.71
8.0.290.0070.00016.75
8.0.280.0000.00818.38
8.0.270.0000.00717.33
8.0.260.0000.00818.52
8.0.250.0030.00516.96
8.0.240.0000.00816.88
8.0.230.0030.00316.98
8.0.220.0070.00016.91
8.0.210.0000.00716.96
8.0.200.0040.00416.95
8.0.190.0070.00016.92
8.0.180.0000.00716.81
8.0.170.0040.00416.91
8.0.160.0080.00016.94
8.0.150.0040.00416.82
8.0.140.0040.00416.88
8.0.130.0030.00313.35
8.0.120.0000.00716.84
8.0.110.0000.00816.82
8.0.100.0030.00516.87
8.0.90.0040.00417.04
8.0.80.0100.01016.86
8.0.70.0040.00416.98
8.0.60.0000.00816.96
8.0.50.0050.00316.96
8.0.30.0070.01017.17
8.0.20.0120.00917.18
8.0.10.0030.00617.05
8.0.00.0120.00516.82
7.4.330.0020.00215.55
7.4.320.0060.00016.66
7.4.300.0030.00316.68
7.4.290.0000.00816.58
7.4.280.0040.00416.67
7.4.270.0030.00316.61
7.4.260.0070.00016.51
7.4.250.0030.00316.57
7.4.240.0000.00716.66
7.4.230.0070.00016.61
7.4.220.0040.00416.63
7.4.210.0070.00816.60
7.4.200.0040.00416.50
7.4.160.0100.00616.55
7.4.140.0130.00817.86
7.4.130.0130.00916.45
7.4.120.0100.00716.53
7.4.110.0120.00616.45
7.4.100.0030.01416.45
7.4.90.0110.00616.49
7.4.80.0070.01419.39
7.4.70.0040.01416.52
7.4.60.0030.01316.49
7.4.50.0050.00816.64
7.4.40.0060.01116.37
7.4.00.0070.00715.16
7.3.330.0050.00013.34
7.3.320.0060.00013.25
7.3.310.0000.00716.37
7.3.300.0000.00716.24
7.3.290.0080.00016.21
7.3.280.0100.00816.33
7.3.260.0140.00716.66
7.3.240.0080.01116.36
7.3.230.0130.01016.65
7.3.210.0130.00316.58
7.3.200.0140.00416.52
7.3.190.0130.00716.47
7.3.180.0060.01016.32
7.3.170.0100.00716.57
7.3.160.0040.01216.60
7.3.60.0060.00614.95
7.3.50.0120.00014.67
7.3.40.0120.00014.68
7.3.30.0000.01714.79
7.3.20.0220.00314.84
7.3.10.0120.01514.55
7.3.00.0220.00414.84
7.2.330.0060.01216.43
7.2.320.0120.01316.76
7.2.310.0100.00616.68
7.2.300.0030.01316.47
7.2.290.0080.00816.59
7.2.190.0090.00315.10
7.2.180.0070.00714.82
7.2.170.0060.00614.88
7.2.160.0030.01114.91
7.2.150.0070.01015.17
7.2.140.0090.00614.96
7.2.130.0220.00615.15
7.2.120.0170.00914.97
7.2.110.0120.00314.84
7.2.100.0180.00315.06
7.2.90.0150.01214.94
7.2.80.0090.00614.98
7.2.70.0090.00614.92
7.2.60.0140.00715.06
7.2.50.0150.00615.11
7.2.40.0130.01615.09
7.2.30.0170.00015.13
7.2.20.0070.00714.98
7.2.10.1050.00315.11
7.2.00.0120.00915.09
7.1.300.0100.00713.76
7.1.290.0120.00613.97
7.1.280.0110.01513.73
7.1.270.0120.01213.97
7.1.260.0140.00713.69
7.1.250.0140.01113.66

preferences:
38.61 ms | 403 KiB | 5 Q