3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); namespace GetObjectVars; // use function PHPStan\Testing\assertType; function assertType($_, $a) {var_dump($a);} class Base { public int $a = 1; public string $b = ''; protected string $c = ''; private bool $d = false; public function getVars(): void { assertType('array{a: int, b: string, c: string, d: bool}', get_object_vars($this)); } } class Extended extends Base { public string $foo = 'foo'; public function getExtendedVars(): void { assertType('array{a: int, b: string, c: string}', get_object_vars($this)); } } (new Base)->getVars(); (new Extended)->getVars(); (new Extended)->getExtendedVars();

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.140.0140.00917.45
8.4.130.0060.00417.94
8.4.120.0090.01122.21
8.4.110.0110.00822.29
8.4.100.0110.00920.61
8.4.90.0130.00818.46
8.4.80.0130.00718.97
8.4.70.0080.00818.24
8.4.60.0090.00718.68
8.4.50.0120.00918.65
8.4.40.0100.01023.95
8.4.30.0030.00618.40
8.4.20.0090.00020.64
8.4.10.0060.00323.74
8.3.270.0080.01216.47
8.3.260.0110.00816.32
8.3.250.0120.00718.68
8.3.240.0120.00816.66
8.3.230.0130.00816.59
8.3.220.0080.01017.21
8.3.210.0090.00818.36
8.3.200.0060.00316.55
8.3.190.0050.00318.66
8.3.180.0020.00616.32
8.3.170.0110.00718.57
8.3.160.0100.01019.12
8.3.150.0120.00417.31
8.3.140.0050.00316.73
8.3.130.0100.00018.32
8.3.120.0050.00320.47
8.3.110.0000.00716.77
8.3.100.0000.00816.45
8.3.90.0040.00426.77
8.3.80.0090.00018.30
8.3.70.0110.00418.30
8.3.60.0140.00718.31
8.3.50.0110.00716.62
8.3.40.0040.01121.88
8.3.30.0070.00718.58
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.290.0110.00820.47
8.2.280.0040.00719.95
8.2.270.0110.00717.06
8.2.260.0180.00016.54
8.2.250.0030.00716.48
8.2.240.0040.00416.75
8.2.230.0060.00320.94
8.2.220.0000.00824.06
8.2.210.0120.00826.77
8.2.200.0040.00416.48
8.2.190.0150.00016.58
8.2.180.0090.00616.38
8.2.170.0000.01518.58
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0090.00026.16
8.2.120.0040.00421.07
8.2.110.0060.00320.50
8.2.100.0040.00817.66
8.2.90.0000.00817.50
8.2.80.0040.00418.54
8.2.70.0050.00317.50
8.2.60.0000.00917.38
8.2.50.0050.00317.55
8.2.40.0090.00019.22
8.2.30.0100.00517.47
8.2.20.0070.00317.46
8.2.10.0110.00617.61
8.2.00.0130.00317.43
8.1.330.0140.00521.86
8.1.320.0110.00815.95
8.1.310.0100.00718.26
8.1.300.0070.00318.70
8.1.290.0070.00430.84
8.1.280.0150.00625.92
8.1.270.0040.00424.66
8.1.260.0060.00326.35
8.1.250.0110.00428.09
8.1.240.0030.00723.80
8.1.230.0040.00820.76
8.1.220.0040.00418.46
8.1.210.0000.00818.77
8.1.200.0060.00617.30
8.1.190.0000.00817.00
8.1.180.0080.00018.10
8.1.170.0000.00817.62
8.1.160.0000.01617.32
8.1.150.0120.00417.29
8.1.140.0120.00317.36
8.1.130.0060.01217.39
8.1.120.0130.00317.39
8.1.110.0120.00417.39
8.1.100.0090.00617.29
8.1.90.0080.00517.40
8.1.80.0070.00417.41
8.1.70.0000.00817.36
8.1.60.0130.00017.59
8.1.50.0140.00017.60
8.1.40.0120.00817.62
8.1.30.0140.00417.64
8.1.20.0090.00917.59
8.1.10.0160.00317.50
8.1.00.0080.00817.28
8.0.300.0000.00818.77
8.0.290.0000.00816.75
8.0.280.0050.00916.72
8.0.270.0100.00316.67
8.0.260.0100.00316.75
8.0.250.0140.00016.78
8.0.240.0120.00416.70
8.0.230.0120.00216.65
8.0.220.0070.00716.68
8.0.210.0060.00616.61
8.0.200.0150.00016.68
8.0.190.0120.00016.70
8.0.180.0120.00016.63
8.0.170.0050.00516.66
8.0.160.0070.00316.56
8.0.150.0050.00516.67
8.0.140.0040.00816.68
8.0.130.0050.00516.59
8.0.120.0090.00016.59
8.0.110.0000.01416.67
8.0.100.0110.00316.66
8.0.90.0040.00816.71
8.0.80.0090.00616.60
8.0.70.0150.00016.69
8.0.60.0090.00616.68
8.0.50.0000.00916.54
8.0.30.0050.00316.70
8.0.20.0000.00816.80
8.0.10.0070.00416.71

preferences:
30.08 ms | 403 KiB | 5 Q