3v4l.org

run code in 300+ PHP versions simultaneously
<?php function shouldFileBeHiddenA(string $file): bool { static $knownHiddenFiles = ['.access', '.', '.htaccess']; if(in_array($file, $knownHiddenFiles)) { return true; } if(str_ends_with($file, '.php')) { return true; } return false; } function shouldFileBeHiddenB(string $file): bool { static $knownHiddenFiles = ['.access', '.', '.htaccess']; static $knownHiddenExtensions = ['php']; if(in_array($file, $knownHiddenFiles)) { return true; } if(in_array(pathinfo($file, PATHINFO_EXTENSION), $knownHiddenExtensions)) { return true; } return false; } var_dump(shouldFileBeHiddenA('.htaccess')); var_dump(shouldFileBeHiddenA('test.php')); var_dump(shouldFileBeHiddenA('test.html')); var_dump(shouldFileBeHiddenB('.htaccess')); var_dump(shouldFileBeHiddenB('test.php')); var_dump(shouldFileBeHiddenB('test.html'));

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.0090.01417.53
8.4.130.0120.00517.71
8.4.120.0040.00724.26
8.4.110.0090.01122.41
8.4.100.0110.01018.54
8.4.90.0100.01018.47
8.4.80.0130.00118.82
8.4.70.0070.00417.73
8.4.60.0110.00917.66
8.4.50.0100.01018.57
8.4.40.0080.01117.77
8.4.30.0130.00618.55
8.4.20.0100.01017.86
8.4.10.0030.00622.09
8.3.270.0140.00616.48
8.3.260.0080.00116.45
8.3.250.0100.00918.93
8.3.240.0090.00917.28
8.3.230.0140.00516.56
8.3.220.0050.00318.97
8.3.210.0120.00516.60
8.3.200.0120.00416.45
8.3.190.0070.00917.33
8.3.180.0060.00818.95
8.3.170.0000.00817.32
8.3.160.0000.00716.77
8.3.150.0110.00416.55
8.3.140.0080.00016.68
8.3.130.0080.00016.79
8.3.120.0040.00419.10
8.3.110.0050.00320.94
8.3.100.0160.00324.06
8.3.90.0050.00326.77
8.3.80.0090.00016.38
8.3.70.0120.00318.55
8.3.60.0150.00316.63
8.3.50.0080.00820.18
8.3.40.0040.01120.47
8.3.30.0070.01018.50
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0060.01020.48
8.2.280.0150.00416.55
8.2.270.0070.00316.75
8.2.260.0070.01116.86
8.2.250.0030.00616.46
8.2.240.0080.00818.69
8.2.230.0030.00622.58
8.2.220.0050.00537.54
8.2.210.0030.00526.77
8.2.200.0060.00316.38
8.2.190.0100.01318.42
8.2.180.0130.00325.92
8.2.170.0110.00418.83
8.2.160.0110.00422.96
8.2.150.0060.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0080.00020.53
8.2.100.0060.00617.66
8.2.90.0050.00317.63
8.2.80.0040.00418.73
8.2.70.0060.00317.38
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0000.00718.22
8.2.30.0000.00817.97
8.2.20.0040.00419.23
8.2.10.0030.00518.01
8.2.00.0000.00819.27
8.1.330.0130.00621.82
8.1.320.0120.00616.36
8.1.310.0030.00616.73
8.1.300.0090.00018.06
8.1.290.0040.00430.84
8.1.280.0060.00825.92
8.1.270.0030.00623.77
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00322.08
8.1.230.0080.00420.91
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0080.00017.10
8.1.190.0040.00417.11
8.1.180.0040.00418.10
8.1.170.0000.00918.61
8.1.160.0000.00918.93
8.1.150.0040.00418.53
8.1.140.0070.00017.30
8.1.130.0030.00318.97
8.1.120.0000.00717.49
8.1.110.0030.00617.39
8.1.100.0050.00317.37
8.1.90.0000.01617.29
8.1.80.0100.00617.25
8.1.70.0120.00317.21
8.1.60.0120.00617.45
8.1.50.0180.00017.46
8.1.40.0100.00717.45
8.1.30.0150.00317.54
8.1.20.0060.00617.44
8.1.10.0120.00317.33
8.1.00.0140.00017.39
8.0.300.0000.00718.77
8.0.290.0050.00516.75
8.0.280.0100.00020.16
8.0.270.0030.00317.97
8.0.260.0030.00318.43
8.0.250.0000.00716.96
8.0.240.0040.00416.90
8.0.230.0020.00516.94
8.0.220.0120.00216.76
8.0.210.0060.00616.80
8.0.200.0040.00916.80
8.0.190.0090.00616.87
8.0.180.0120.00416.78
8.0.170.0120.00416.81
8.0.160.0110.00516.88
8.0.150.0140.00016.82
8.0.140.0130.00316.79
8.0.130.0090.00616.75
8.0.120.0160.00016.72
8.0.110.0150.00016.78
8.0.100.0150.00016.86
8.0.90.0120.00216.66
8.0.80.0110.00416.72
8.0.70.0140.00016.84
8.0.60.0100.00316.82
8.0.50.0080.00516.75
8.0.30.0110.00416.69
8.0.20.0140.00316.81
8.0.10.0110.00716.93
7.4.330.0070.00015.55
7.4.320.0000.00616.43
7.4.300.0180.00016.58
7.4.290.0100.00516.59
7.4.280.0110.00816.58
7.4.270.0120.00516.57
7.4.260.0160.00016.37
7.4.250.0100.00516.45
7.4.240.0110.00316.47
7.4.230.0080.00816.58
7.4.220.0100.00316.57
7.4.210.0100.00516.37
7.4.200.0080.00816.45
7.4.190.0100.00216.47
7.4.180.0050.00916.51
7.4.160.0090.00316.43
7.4.150.0130.00316.44
7.4.140.0060.00616.40
7.4.130.0160.00016.52
7.4.120.0100.00316.26
7.4.110.0110.00416.30
7.4.100.0040.01116.49
7.4.90.0090.00416.42
7.4.80.0040.00816.40
7.4.70.0080.00316.37
7.4.60.0020.00916.36
7.4.50.0060.00616.25
7.4.40.0000.00916.37
7.4.30.0070.00416.35
7.4.20.0050.00516.46
7.4.10.0060.00316.42
7.4.00.0030.00616.46

preferences:
29.51 ms | 403 KiB | 5 Q