3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum WeekDay: string { case Monday = 'monday'; case Tuesday = 'tuesday'; case Wednesday = 'wednesday'; case Thursday = 'thursday'; case Friday = 'friday'; case Saturday = 'saturday'; case Sunday = 'sunday'; } class Foo { public function hello() { return "Hello world" . PHP_EOL; } } $array = []; $array[WeekDay::Monday->value] = new Foo(); // etc echo $array[WeekDay::Monday->value]->hello(); $map = new WeakMap(); $map[WeekDay::Monday] = new Foo(); // etc echo $map[WeekDay::Monday]->hello();

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.30.0020.00718.02
8.5.20.0090.00820.21
8.5.10.0070.01216.62
8.5.00.0110.01123.16
8.4.180.0120.01119.70
8.4.170.0120.01024.08
8.4.160.0130.00822.13
8.4.150.0080.00417.69
8.4.140.0100.01217.79
8.4.130.0100.01217.78
8.4.120.0120.01017.74
8.4.110.0380.01117.61
8.4.100.0340.00817.73
8.4.90.0450.00717.55
8.4.80.0220.00817.65
8.4.70.0400.00917.71
8.4.60.0230.00617.80
8.4.50.0160.00517.66
8.4.40.0210.00317.45
8.4.30.0170.00617.36
8.4.20.0200.00417.70
8.4.10.0330.00617.46
8.3.300.0120.00820.77
8.3.290.0120.00720.72
8.3.280.0110.00918.53
8.3.270.0110.00816.43
8.3.260.0130.00516.84
8.3.250.0140.00716.62
8.3.240.0370.00716.71
8.3.230.0390.00816.54
8.3.220.0510.00916.55
8.3.210.0360.01016.48
8.3.200.0390.00816.39
8.3.190.0380.00716.46
8.3.180.0400.00816.31
8.3.170.0430.00716.45
8.3.160.0470.00616.22
8.3.150.0400.01116.31
8.3.140.0400.01016.31
8.3.130.0220.00516.68
8.3.120.0160.00416.65
8.3.110.0300.00816.32
8.3.100.0260.00716.34
8.3.90.0370.00916.42
8.3.80.0260.00316.79
8.3.70.0280.00316.31
8.3.60.0290.00616.45
8.3.50.0300.00516.45
8.3.40.0450.00817.45
8.3.30.0310.00817.54
8.3.20.0360.00917.40
8.3.10.0280.01017.31
8.3.00.0160.00417.58
8.2.300.0130.00920.50
8.2.290.0130.00516.32
8.2.280.0160.00216.47
8.2.270.0270.01016.48
8.2.260.0310.00816.39
8.2.250.0150.00916.51
8.2.240.0310.00716.54
8.2.230.0250.00416.56
8.2.220.0320.00916.30
8.2.210.0330.00716.28
8.2.200.0330.00816.71
8.2.190.0300.01316.46
8.2.180.0320.01016.36
8.2.170.0290.01117.73
8.2.160.0350.00817.61
8.2.150.0350.01117.61
8.2.140.0340.00817.46
8.2.130.0370.00817.38
8.2.120.0220.00717.65
8.2.110.0210.00617.51
8.2.100.0230.00717.52
8.2.90.0410.00717.74
8.2.80.0350.00917.76
8.2.70.0360.00717.48
8.2.60.0390.00317.38
8.2.50.0440.00717.68
8.2.40.0240.00517.60
8.2.30.0310.00917.63
8.2.20.0310.00617.44
8.2.10.0150.00417.38
8.2.00.0270.00717.39
8.1.340.0120.00921.93

preferences:
67.93 ms | 842 KiB | 5 Q