3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait dumper { 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 A { use dumper; private int $a = 1; } class B extends A { } class C extends B { use dumper; private int $a = 2; } print "Class A\n"; (new A())->doit(); print "\n\nClass B\n"; (new B())->doit(); print "\n\nClass C\n"; (new C())->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.4.20.0140.00719.77
8.4.10.0040.00419.55
8.3.150.0000.02016.79
8.3.140.0130.00618.46
8.3.130.0040.00418.43
8.3.120.0120.00619.00
8.3.110.0030.00620.94
8.3.100.0030.00616.61
8.3.90.0080.00026.77
8.3.80.0030.00617.97
8.3.70.0120.00318.31
8.3.60.0480.00725.92
8.3.50.0160.00625.92
8.3.40.0310.00925.92
8.3.30.0340.00625.92
8.3.20.0300.01025.92
8.3.10.0260.01325.92
8.3.00.0320.00425.92
8.2.260.0040.00417.17
8.2.250.0070.00316.63
8.2.240.0090.00918.89
8.2.230.0100.00022.58
8.2.220.0000.00924.06
8.2.210.0080.00026.77
8.2.200.0070.00316.38
8.2.190.0000.01516.63
8.2.180.0330.00725.92
8.2.170.0410.00625.92
8.2.160.0260.01225.92
8.2.150.0490.00325.92
8.2.140.0330.00725.92
8.2.130.0290.01325.92
8.2.120.0410.00725.92
8.2.110.0350.00725.92
8.2.100.0230.01025.92
8.2.90.0360.00725.92
8.2.80.0350.01125.92
8.2.70.0380.00925.92
8.2.60.0360.00725.92
8.2.50.0230.01325.92
8.2.40.0240.01225.92
8.2.30.0380.00025.92
8.2.20.0360.01025.92
8.2.10.0310.01025.92
8.2.00.0290.01325.92
8.1.310.0030.00516.82
8.1.300.0140.00017.70
8.1.290.0060.00330.84
8.1.280.0260.01325.92
8.1.270.0370.00325.92
8.1.260.0300.01025.92
8.1.250.0250.00925.92
8.1.240.0290.01325.92
8.1.230.0290.01425.92
8.1.220.0400.00325.92
8.1.210.0330.01025.92
8.1.200.0350.00725.92
8.1.190.0200.00325.92
8.1.180.0310.01225.92
8.1.170.0400.00525.92
8.1.160.0330.01225.92
8.1.150.0240.02025.92
8.1.140.0450.00025.92
8.1.130.0350.00825.92
8.1.120.0290.00925.92
8.1.110.0260.00425.92
8.1.100.0280.00625.92
8.1.90.0260.00425.92
8.1.80.0350.00625.92
8.1.70.0320.00425.92
8.1.60.0250.00825.92
8.1.50.0290.01825.92
8.1.40.0370.01625.92
8.1.30.0320.01025.92
8.1.20.0320.00725.92
8.1.10.0370.00925.92
8.1.00.0270.01825.92

preferences:
39 ms | 403 KiB | 5 Q