3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_even(int $n): bool { $fn = null; $fn = static function(int $nr) use($fn): bool { if ($nr < 0) { $nr = abs($nr); } if ($nr === 0) { return true; } return $fn($nr - 1); }; return $fn($n, false); } for($i = -5; $i <= 12; $i++) { printf('is %d even? %s.%s', $i, is_even($i) ? 'yes': 'no', "\n"); }

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.0130.00316.75
8.3.50.0100.01016.33
8.3.40.0030.01218.98
8.3.30.0030.01218.73
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.180.0120.00325.92
8.2.170.0160.00619.03
8.2.160.0030.01822.96
8.2.150.0040.00425.66
8.2.140.0030.01424.66
8.2.130.0060.00326.16
8.2.120.0030.00626.35
8.2.110.0100.00720.38
8.2.100.0030.00917.91
8.2.90.0040.00417.75
8.2.80.0000.00818.75
8.2.70.0040.00417.93
8.2.60.0000.00918.16
8.2.50.0090.00018.10
8.2.40.0050.00219.34
8.2.30.0040.00419.26
8.2.20.0040.00418.07
8.2.10.0080.00019.38
8.2.00.0050.00219.20
8.1.280.0110.01125.92
8.1.270.0080.00023.99
8.1.260.0040.00428.09
8.1.250.0060.00328.09
8.1.240.0100.00721.05
8.1.230.0040.00817.71
8.1.220.0030.00617.78
8.1.210.0030.00518.77
8.1.200.0050.00517.35
8.1.190.0060.00317.23
8.1.180.0050.00318.10
8.1.170.0090.00018.57
8.1.160.0020.00519.02
8.1.150.0000.00718.65
8.1.140.0040.00418.79
8.1.130.0070.00021.83
8.1.120.0050.00317.34
8.1.110.0080.00017.32
8.1.100.0040.00417.37
8.1.90.0040.00417.47
8.1.80.0040.00417.38
8.1.70.0070.00017.49
8.1.60.0000.00817.58
8.1.50.0030.00517.44
8.1.40.0030.00617.42
8.1.30.0000.00817.67
8.1.20.0000.00817.60
8.1.10.0040.00417.55
8.1.00.0000.00817.51
8.0.300.0070.00018.77
8.0.290.0040.00416.63
8.0.280.0040.00418.32
8.0.270.0000.00718.07
8.0.260.0030.00320.11
8.0.250.0060.00317.04
8.0.240.0040.00417.00
8.0.230.0000.00717.00
8.0.220.0000.00716.95
8.0.210.0000.00816.94
8.0.200.0070.00016.91
8.0.190.0000.00716.99
8.0.180.0040.00416.98
8.0.170.0070.00317.02
8.0.160.0000.00817.00
8.0.150.0070.00016.93
8.0.140.0000.00716.88
8.0.130.0030.00313.31
8.0.120.0030.00516.82
8.0.110.0000.00717.00
8.0.100.0000.00717.07
8.0.90.0040.00417.02
8.0.80.0040.01016.94
8.0.70.0070.00016.84
8.0.60.0050.00317.02
8.0.50.0000.00816.75
8.0.30.0090.01217.01
8.0.20.0090.01116.97
8.0.10.0040.00417.12
8.0.00.0130.01316.88
7.4.330.0020.00215.55
7.4.320.0040.00416.57
7.4.300.0030.00316.57
7.4.290.0000.00716.48
7.4.280.0050.00316.58
7.4.270.0030.00316.47
7.4.260.0000.00513.28
7.4.250.0070.00016.53
7.4.240.0030.00316.53
7.4.230.0000.00716.54
7.4.220.0040.00316.50
7.4.210.0080.01116.57
7.4.200.0040.00316.26
7.4.130.0110.01016.50
7.4.120.0170.00716.56
7.4.110.0100.01016.66
7.4.100.0070.01016.55
7.4.90.0100.01316.62
7.4.80.0230.00316.52
7.4.70.0330.00316.41
7.4.60.0180.01816.62
7.4.50.0200.01216.66
7.4.40.0190.00616.46
7.4.30.0120.00616.25
7.4.20.0180.00416.41
7.4.10.0130.00316.34
7.4.00.0110.01116.66
7.3.330.0000.00816.23
7.3.320.0030.00313.24
7.3.310.0030.00316.29
7.3.300.0030.00516.40
7.3.290.0080.00816.41
7.3.280.0040.02116.45
7.3.260.0090.00916.50
7.3.230.0060.01016.41
7.3.210.0150.00716.37
7.3.200.0120.00816.47
7.3.190.0240.00816.43
7.3.180.0310.00616.46
7.3.170.0230.00916.66
7.3.160.0090.00916.40
7.3.150.0230.00316.27
7.3.140.0100.00716.55
7.3.130.0080.00816.57
7.3.120.0130.00616.36
7.3.110.0000.01616.54
7.3.100.0040.01116.37
7.3.90.0040.01216.41
7.3.80.0060.00916.47
7.3.70.0050.01116.41
7.3.60.0060.01016.47
7.3.50.0090.01316.27
7.3.40.0070.01016.23
7.3.30.0060.00916.58
7.3.20.0080.01116.38
7.3.10.0100.00716.53
7.3.00.0030.01216.63
7.2.330.0090.00916.54
7.2.320.0290.01316.75
7.2.310.0290.00916.70
7.2.300.0160.01716.53
7.2.290.0250.00316.51
7.2.280.0220.00416.66
7.2.270.0180.00516.54
7.2.260.0090.01116.64
7.2.250.0040.01216.42
7.2.240.0070.01216.71
7.2.230.0120.00516.69
7.2.220.0030.01316.36
7.2.210.0160.00016.61
7.2.200.0090.00616.54
7.2.190.0070.01016.57
7.2.180.0080.00816.50
7.2.170.0190.00316.50
7.2.160.0100.00716.70
7.2.150.0130.00716.49
7.2.140.0060.00916.75
7.2.130.0100.01316.66
7.2.120.0080.01016.64
7.2.110.0000.01916.55
7.2.100.0170.00316.73
7.2.90.0080.01416.64
7.2.80.0100.01316.54
7.2.70.0110.00716.68
7.2.60.0110.01416.48
7.2.50.0060.01216.58
7.2.40.0090.00816.68
7.2.30.0090.00916.64
7.2.20.0090.00916.66
7.2.10.0160.01416.71
7.2.00.0000.02116.68

preferences:
63.74 ms | 401 KiB | 5 Q