3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum CacheHit { case CacheHit; } function foo(string $foo): string|CacheHit { static $data = []; if (isset($data[$foo])) { return CacheHit::CacheHit; } $data[$foo] = true; return $foo; } var_dump(foo('foo')); var_dump(foo('bar')); var_dump(foo('bar'));

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.0100.00820.00
8.5.20.0130.00619.99
8.5.10.0120.00418.88
8.5.00.0130.00820.20
8.4.180.0150.00919.77
8.4.170.0130.00921.92
8.4.160.0140.00822.10
8.4.150.0090.00516.90
8.4.140.0150.01017.65
8.4.130.0040.00518.88
8.4.120.0040.00519.73
8.4.110.0060.00318.02
8.4.100.0130.00717.50
8.4.90.0120.00820.45
8.4.80.0130.00718.89
8.4.70.0050.01324.11
8.4.60.0040.00520.53
8.4.50.0110.00918.84
8.4.40.0190.00319.27
8.4.30.0110.00820.29
8.4.20.0140.00717.82
8.4.10.0030.00620.66
8.3.300.0090.01218.52
8.3.290.0130.00620.77
8.3.280.0090.01118.37
8.3.270.0110.00516.68
8.3.260.0060.00416.59
8.3.250.0100.00916.66
8.3.240.0040.00516.55
8.3.230.0110.00916.30
8.3.220.0050.00418.88
8.3.210.0110.00816.82
8.3.200.0040.00516.73
8.3.190.0100.00617.05
8.3.180.0070.00718.86
8.3.170.0070.00717.04
8.3.160.0120.00618.44
8.3.150.0100.01021.04
8.3.140.0030.00516.53
8.3.130.0060.00918.44
8.3.120.0000.00818.98
8.3.110.0050.00318.54
8.3.100.0040.01618.22
8.3.50.0040.00418.43
8.2.300.0120.01022.27
8.2.290.0100.00918.53
8.2.280.0170.00418.52
8.2.270.0060.01316.74
8.2.260.0030.00618.42
8.2.250.0080.00016.61
8.2.240.0070.01017.41
8.2.230.0090.00618.32
8.2.220.0000.00818.38
8.1.340.0120.01019.46
8.1.330.0120.00715.82
8.1.320.0120.00716.13
8.1.310.0090.00617.72
8.1.300.0070.01118.36
8.1.40.0190.00317.43
8.1.30.0180.00617.55
8.1.20.0190.00617.54
8.1.10.0190.00617.42
8.1.00.0220.00017.42
8.0.170.0220.00016.71
8.0.160.0100.00916.84
8.0.150.0150.00616.79
8.0.140.0150.00616.71
8.0.130.0150.00616.74
8.0.120.0170.00316.77
8.0.110.0100.00316.73
8.0.100.0000.01016.88
8.0.90.0100.00316.74
8.0.80.0120.00216.79
8.0.70.0050.00916.68
8.0.60.0130.00016.71
8.0.50.0150.00416.77
8.0.30.0130.00816.65
8.0.20.0230.00016.75
8.0.10.0160.00416.70
7.4.280.0220.00016.38
7.4.270.0150.00816.32
7.4.260.0080.00316.25
7.4.250.0080.00016.45
7.4.240.0070.00216.30
7.4.230.0040.00416.34
7.4.220.0130.00316.44
7.4.210.0140.00516.21
7.4.200.0140.00016.33
7.4.190.0040.00416.45
7.4.180.0000.00716.43
7.4.160.0030.00616.39
7.4.150.0100.00016.39
7.4.140.0100.00016.14
7.4.130.0070.00316.11
7.4.120.0080.00316.13
7.4.110.0030.00716.12
7.4.100.0050.00516.43
7.4.90.0050.00516.22
7.4.80.0060.00416.30
7.4.70.0060.00316.11
7.4.60.0070.00316.13
7.4.50.0050.00516.14
7.4.40.0030.00716.15
7.4.30.0090.00016.04
7.4.20.0030.00616.14
7.4.10.0070.00316.07
7.4.00.0090.00016.24

preferences:
43 ms | 937 KiB | 5 Q