3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Item { private $timeout = 0; public function expiresAfter($timeout) { $this->timeout = $timeout; } public function getTimeout() { return $this->timeout; } } class CacheHelper { static public function expiresAfter($time) { return function ($item) use ($time) { $item->expiresAfter($time); }; } } $item = new Item; (CacheHelper::expiresAfter(30))($item); echo $item->getTimeout();

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.3.60.0070.01116.50
8.3.50.0110.00616.47
8.3.40.0190.00319.00
8.3.30.0090.00618.70
8.3.20.0070.00020.25
8.3.10.0040.00423.53
8.3.00.0050.00319.68
8.2.180.0090.00616.75
8.2.170.0000.01522.96
8.2.160.0030.01220.39
8.2.150.0060.00624.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0050.00317.63
8.2.110.0030.00620.43
8.2.100.0000.01217.91
8.2.90.0050.00318.97
8.2.80.0040.00817.97
8.2.70.0080.00017.50
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0000.00819.34
8.2.30.0030.00718.13
8.2.20.0040.00417.76
8.2.10.0030.00617.93
8.2.00.0000.00817.96
8.1.280.0180.00325.92
8.1.270.0110.00720.36
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.84
8.1.230.0040.00720.97
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0030.00617.25
8.1.190.0050.00317.25
8.1.180.0080.00018.10
8.1.170.0080.00018.72
8.1.160.0040.00422.01
8.1.150.0050.00218.90
8.1.140.0000.01117.45
8.1.130.0000.00717.71
8.1.120.0000.00717.45
8.1.110.0030.00517.43
8.1.100.0000.00717.30
8.1.90.0000.00717.36
8.1.80.0070.00017.39
8.1.70.0030.00317.45
8.1.60.0000.00717.60
8.1.50.0050.00517.49
8.1.40.0030.00617.52
8.1.30.0030.00617.66
8.1.20.0030.00617.58
8.1.10.0040.00417.55
8.1.00.0000.00717.49
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0070.00018.44
8.0.270.0040.00417.29
8.0.260.0040.00417.26
8.0.250.0000.00716.96
8.0.240.0030.00316.84
8.0.230.0070.00016.95
8.0.220.0030.00316.79
8.0.210.0070.00016.93
8.0.200.0030.00316.78
8.0.190.0030.00516.81
8.0.180.0040.00416.81
8.0.170.0000.00816.96
8.0.160.0040.00416.85
8.0.150.0050.00216.86
8.0.140.0000.00716.85
8.0.130.0070.00013.38
8.0.120.0000.00816.84
8.0.110.0050.00316.88
8.0.100.0040.00416.82
8.0.90.0000.00716.78
8.0.80.0000.01516.89
8.0.70.0050.00316.66
8.0.60.0060.00316.79
8.0.50.0000.00816.77
8.0.30.0110.01117.11
8.0.20.0120.00917.40
8.0.10.0000.00717.07
8.0.00.0110.00916.81
7.4.330.0000.00515.08
7.4.320.0000.00716.37
7.4.300.0040.00416.60
7.4.290.0000.00716.59
7.4.280.0080.00016.59
7.4.270.0030.00316.61
7.4.260.0030.00516.47
7.4.250.0040.00416.47
7.4.240.0020.00616.46
7.4.230.0020.00516.34
7.4.220.0140.00316.66
7.4.210.0100.00416.57
7.4.200.0000.00716.63
7.4.160.0030.01216.43
7.4.150.0110.00717.40
7.4.140.0100.01117.86
7.4.130.0050.01316.50
7.4.120.0080.01116.37
7.4.110.0090.00916.50
7.4.100.0070.01116.57
7.4.90.0120.01216.56
7.4.80.0030.01319.39
7.4.70.0140.00316.48
7.4.60.0120.00416.32
7.4.50.0000.00816.59
7.4.40.0080.00816.70
7.4.30.0120.00916.59
7.4.00.0040.01114.88
7.3.330.0000.00513.16
7.3.320.0000.00513.25
7.3.310.0030.00316.43
7.3.300.0070.00016.32
7.3.290.0030.00316.18
7.3.280.0100.00816.29
7.3.270.0130.00317.40
7.3.260.0140.00316.40
7.3.240.0100.00716.46
7.3.230.0060.01116.39
7.3.210.0060.00916.42
7.3.200.0100.00516.29
7.3.190.0120.00916.30
7.3.180.0080.00816.28
7.3.170.0060.01216.52
7.3.160.0080.01516.14
7.2.330.0090.00916.78
7.2.320.0100.00716.39
7.2.310.0130.00316.76
7.2.300.0090.00916.54
7.2.290.0100.00716.52
7.2.60.0030.01117.01
7.2.00.0140.00019.27
7.1.200.0080.00315.67
7.1.100.0040.00818.38
7.1.70.0000.00717.02
7.1.60.0100.01419.12
7.1.50.0060.01517.04
7.1.00.0030.07322.33
7.0.200.0040.00716.79
7.0.60.0030.06720.02
7.0.50.0030.07717.97
7.0.40.0070.06320.21
7.0.30.0500.06720.09
7.0.20.0300.05020.24
7.0.10.0030.06020.10
7.0.00.0030.05020.33
5.6.280.0070.07021.13
5.6.210.0100.06020.68
5.6.200.0030.04318.22
5.6.190.0030.08020.39
5.6.180.0300.05320.42
5.6.170.0400.07320.58
5.6.160.0000.04720.54
5.6.150.0030.09318.19
5.6.140.0130.07318.21
5.6.130.0100.08018.19
5.6.120.0030.04721.02
5.6.110.0130.07321.02
5.6.100.0170.07321.15
5.6.90.0100.05721.03
5.6.80.0070.05720.50
5.5.350.0100.06720.46
5.5.340.0070.07717.95
5.5.330.0170.05720.28
5.5.320.0200.04320.36
5.5.310.0470.06320.30
5.5.300.0130.07317.94
5.5.290.0000.05717.98
5.5.280.0030.04020.88
5.5.270.0170.07320.90
5.5.260.0130.07720.88
5.5.250.0000.04320.63
5.5.240.0200.08020.28
5.4.450.0970.06319.14
5.4.440.1070.04719.26
5.4.430.1000.05019.24
5.4.420.1130.04019.59
5.4.410.1000.04719.24
5.4.400.1070.04019.25
5.4.390.1000.04719.27
5.4.380.1130.05319.10
5.4.370.1030.06319.00
5.4.360.0870.04319.22
5.4.350.0830.04718.93
5.4.340.1130.04319.24
5.4.320.1030.04719.02
5.4.310.0900.05318.82
5.4.300.0970.04719.24
5.4.290.0730.05318.92
5.4.280.0770.05319.27
5.4.270.0930.06318.81
5.4.260.0900.05719.26
5.4.250.1230.04319.19
5.4.240.1000.04719.06
5.4.230.0830.04718.99
5.4.220.0630.05319.04
5.4.210.0670.05319.01
5.4.200.0370.05019.35
5.4.190.0300.06719.26
5.4.180.0630.05019.07
5.4.170.0630.06019.04
5.4.160.0700.05019.19
5.4.150.0630.06019.24
5.4.140.0500.03716.46
5.4.130.0130.05016.45
5.4.120.0170.04716.55
5.4.110.0530.05716.48
5.4.100.0630.05316.69
5.4.90.0630.04316.58
5.4.80.0100.04716.64
5.4.70.0200.05716.48
5.4.60.0430.05016.54
5.4.50.0130.02716.42
5.4.40.0030.06316.51
5.4.30.0030.06316.42
5.4.20.0030.07016.34

preferences:
54.94 ms | 400 KiB | 5 Q