3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private int $a = 1; public function doIt() { print "get_object_vars()\n"; print_r(get_object_vars($this)); $closure = \Closure::bind(static function ($class) { return get_object_vars($class); }, NULL, $this); $vars = $closure($this); print "\n\nClosure\n"; print_r($vars); } } class B extends A { private int $b = 2; } (new B())->doit();

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.120.0000.00920.72
8.3.110.0030.00616.60
8.3.100.0040.00424.06
8.3.90.0040.00426.77
8.3.80.0090.00318.43
8.3.70.0060.00918.55
8.3.60.0070.01416.63
8.3.50.0040.01816.45
8.3.40.0140.00023.67
8.3.30.0070.00722.04
8.3.20.0070.00024.18
8.3.10.0000.02021.72
8.3.00.0120.00618.87
8.2.240.0060.00317.25
8.2.230.0030.00520.94
8.2.220.0000.00937.54
8.2.210.0090.00026.77
8.2.200.0060.00316.50
8.2.190.0070.01116.60
8.2.180.0140.00316.63
8.2.170.0090.00618.59
8.2.160.0090.00622.96
8.2.150.0030.00525.66
8.2.140.0110.00720.43
8.2.130.0190.00020.38
8.2.120.0150.00318.97
8.2.110.0120.00619.15
8.2.100.0150.00419.06
8.2.90.0070.01018.83
8.2.80.0090.00619.02
8.2.70.0030.00518.64
8.2.60.0060.01218.48
8.2.50.0070.01118.63
8.2.40.0080.00018.83
8.2.30.0060.00318.84
8.2.20.0160.00318.66
8.2.10.0130.00918.67
8.2.00.0160.00318.82
8.1.300.0000.00820.16
8.1.290.0060.00330.84
8.1.280.0140.00725.92
8.1.270.0110.00422.14
8.1.260.0060.00922.00
8.1.250.0130.00622.10
8.1.240.0070.01118.45
8.1.230.0130.00618.48
8.1.220.0030.01618.88
8.1.210.0200.00018.41
8.1.200.0070.01318.64
8.1.190.0090.00318.60
8.1.180.0040.00418.29
8.1.170.0000.00818.47
8.1.160.0180.00018.56
8.1.150.0080.00018.64
8.1.140.0090.00018.49
8.1.130.0030.00618.74
8.1.120.0060.00318.62
8.1.110.0060.00318.51
8.1.100.0040.00418.55
8.1.90.0080.00018.69
8.1.80.0040.00418.64
8.1.70.0040.00418.48
8.1.60.0040.00418.66
8.1.50.0000.00818.50
8.1.40.0040.00418.71
8.1.30.0080.00018.82
8.1.20.0080.00018.88
8.1.10.0090.00018.74
8.1.00.0040.00418.44

preferences:
15.41 ms | 403 KiB | 5 Q