3v4l.org

run code in 500+ 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.5.90.0030.00516.88
8.5.80.0050.00316.70
8.5.70.0030.00418.43
8.5.60.0090.00916.74
8.5.50.0070.00716.71
8.5.30.0110.00721.16
8.5.20.0120.00617.71
8.5.10.0090.00918.32
8.5.00.0140.00720.02
8.4.240.0030.00819.64
8.4.230.0130.00819.48
8.4.220.0110.00924.07
8.4.210.0120.00919.51
8.4.180.0050.00425.76
8.4.170.0100.01223.96
8.4.160.0070.01423.75
8.4.150.0080.00516.84
8.4.140.0160.00517.49
8.4.130.0130.00817.63
8.4.120.0110.01020.71
8.4.110.0150.00618.90
8.4.100.0130.00717.75
8.4.90.0080.00517.68
8.4.80.0130.00722.47
8.4.70.0040.00817.70
8.4.60.0130.00718.88
8.4.50.0090.01118.65
8.4.40.0100.01017.54
8.4.30.0090.00919.04
8.4.20.0070.01417.73
8.4.10.0060.00319.36
8.3.330.0140.00818.53
8.3.320.0080.01318.41
8.3.310.0130.00718.46
8.3.300.0090.01320.95
8.3.290.0120.00922.58
8.3.280.0120.00918.39
8.3.270.0090.01016.41
8.3.260.0100.00916.56
8.3.250.0150.00218.88
8.3.240.0080.00716.50
8.3.230.0130.00716.82
8.3.220.0100.00717.18
8.3.210.0090.00916.64
8.3.200.0040.00516.63
8.3.190.0120.00717.41
8.3.180.0110.00816.41
8.3.170.0060.01220.60
8.3.160.0100.00017.20
8.3.150.0040.01117.21
8.3.140.0040.01416.59
8.3.130.0090.00018.24
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.320.0090.01018.08
8.2.310.0140.00718.00
8.2.300.0110.00920.13
8.2.290.0110.00822.18
8.2.280.0130.00820.11
8.2.270.0160.00317.01
8.2.260.0050.00316.50
8.2.250.0100.00616.44
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.340.0120.00817.43
8.1.330.0110.00816.43
8.1.320.0120.00716.00
8.1.310.0030.00516.79
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:
57.76 ms | 1039 KiB | 5 Q