3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace GetObjectVars81; function assertType($_, $a) { var_dump($a); } enum Suit { case Hearts; case Diamonds; case Clubs; case Spades; } enum SuitBacked: string { case Hearts = 'H'; case Diamonds = 'D'; case Clubs = 'C'; case Spades = 'S'; } function check(Suit $suit, SuitBacked $backed): void { assertType('array{a: int, b: string}', get_object_vars($suit)); assertType('array{a: int, b: string}|array{one: int, three: bool}', get_object_vars($backed)); } check(Suit::Hearts, SuitBacked::Diamonds);

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.0120.00817.57
8.4.130.0090.01117.79
8.4.120.0130.00722.22
8.4.110.0130.00924.15
8.4.100.0120.01017.54
8.4.90.0120.00817.73
8.4.80.0040.00617.65
8.4.70.0030.00517.59
8.4.60.0130.00618.61
8.4.50.0110.01020.77
8.4.40.0050.00419.57
8.4.30.0060.00419.55
8.3.270.0150.00516.31
8.3.260.0120.00816.45
8.3.250.0050.00318.80
8.3.240.0130.00616.26
8.3.230.0110.00716.81
8.3.220.0080.00717.36
8.3.210.0110.00816.83
8.3.200.0030.00618.37
8.3.190.0120.00618.85
8.3.180.0030.00516.70
8.3.170.0050.00318.31
8.3.50.0030.00618.38
8.2.290.0090.00922.10
8.2.280.0080.01018.22
8.2.30.0110.00617.62
8.2.20.0040.00417.68
8.2.10.0060.01117.72
8.2.00.0130.00317.62
8.1.330.0110.00718.44
8.1.320.0110.00816.07
8.1.160.0120.00417.29
8.1.150.0100.00617.42
8.1.140.0140.00317.30
8.1.130.0110.00617.23
8.1.120.0160.00017.37
8.1.110.0120.00417.45
8.1.100.0130.00317.39
8.1.90.0080.00817.39
8.1.80.0160.00017.43
8.1.70.0120.00517.45
8.1.60.0160.00317.53
8.1.50.0110.00717.38
8.1.40.0190.00017.48
8.1.30.0120.00617.59
8.1.20.0160.00317.44
8.1.10.0130.00517.47
8.1.00.0150.00317.38
8.0.280.0090.00616.84
8.0.270.0140.00316.84
8.0.260.0120.00416.74
8.0.250.0130.00216.86
8.0.240.0150.00016.90
8.0.230.0120.00316.84
8.0.220.0120.00416.74
8.0.210.0130.00316.77
8.0.200.0150.00416.72
8.0.190.0110.00716.78
8.0.180.0140.00216.76
8.0.170.0110.00416.80
8.0.160.0060.00916.84
8.0.150.0140.00316.72
8.0.140.0120.00316.77
8.0.130.0110.00416.70
8.0.120.0100.00516.78
8.0.110.0150.00016.82
8.0.100.0130.00216.79
8.0.90.0110.00716.79
8.0.80.0130.00316.81
8.0.70.0090.00616.84
8.0.60.0040.01116.82
8.0.50.0130.00316.66
8.0.30.0150.00016.78
8.0.20.0110.00416.84
8.0.10.0100.00516.80

preferences:
38.13 ms | 403 KiB | 5 Q