3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isValidFileName($fileName) { if(!preg_match('/(^[a-zA-Z0-9\.\-\s_]+)\.(jpg|gif|png|bmp)$/i', $fileName)) { return false; } return true; } echo (isValidFileName("file1.jpg"));

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.0180.00416.75
8.3.50.0100.01018.14
8.3.40.0130.00618.95
8.3.30.0070.01118.94
8.3.20.0080.00020.70
8.3.10.0040.00421.90
8.3.00.0050.00321.59
8.2.180.0070.00716.50
8.2.170.0110.00422.96
8.2.160.0100.00322.24
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0110.00419.77
8.2.120.0070.00026.35
8.2.110.0030.00619.30
8.2.100.0040.00817.91
8.2.90.0080.00019.15
8.2.80.0000.00817.97
8.2.70.0050.00317.75
8.2.60.0030.00717.93
8.2.50.0030.00618.10
8.2.40.0030.00520.50
8.2.30.0040.00419.23
8.2.20.0000.00718.07
8.2.10.0040.00417.98
8.2.00.0050.00317.59
8.1.280.0120.00925.92
8.1.270.0080.00022.13
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0040.00421.36
8.1.230.0110.00017.58
8.1.220.0000.00717.74
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0060.00317.35
8.1.180.0000.00718.10
8.1.170.0040.00418.78
8.1.160.0050.00223.92
8.1.150.0050.00320.29
8.1.140.0070.00019.54
8.1.130.0000.00817.58
8.1.120.0060.00317.59
8.1.110.0000.00717.54
8.1.100.0050.00217.59
8.1.90.0070.00017.45
8.1.80.0000.00717.59
8.1.70.0040.00417.44
8.1.60.0040.00417.70
8.1.50.0090.00017.65
8.1.40.0100.00017.61
8.1.30.0040.00417.75
8.1.20.0050.00317.74
8.1.10.0070.00417.60
8.1.00.0040.00417.62
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0040.00418.32
8.0.270.0050.00217.22
8.0.260.0000.00717.25
8.0.250.0030.00316.91
8.0.240.0040.00416.91
8.0.230.0030.00317.00
8.0.220.0030.00316.94
8.0.210.0000.00716.93
8.0.200.0000.00717.02
8.0.190.0000.00716.97
8.0.180.0030.00517.02
8.0.170.0040.00417.05
8.0.160.0080.00016.89
8.0.150.0000.00717.00
8.0.140.0070.00016.86
8.0.130.0050.00013.38
8.0.120.0030.00517.02
8.0.110.0030.00517.04
8.0.100.0040.00416.77
8.0.90.0030.00516.79
8.0.80.0060.01017.01
8.0.70.0030.00517.00
8.0.60.0000.00716.93
8.0.50.0070.00016.93
8.0.30.0130.00617.25
8.0.20.0120.00717.40
8.0.10.0000.00716.91
8.0.00.0040.01516.93
7.4.330.0020.00215.55
7.4.320.0030.00316.66
7.4.300.0000.00716.58
7.4.290.0030.00316.54
7.4.280.0040.00416.54
7.4.270.0000.00716.61
7.4.260.0000.00816.57
7.4.250.0030.00316.62
7.4.240.0040.00416.61
7.4.230.0030.00516.80
7.4.220.0230.01916.74
7.4.210.0070.01416.71
7.4.200.0030.00316.67
7.4.160.0100.00616.69
7.4.150.0090.00917.40
7.4.140.0120.00817.86
7.4.130.0120.00516.74
7.4.120.0080.01116.65
7.4.110.0080.01016.61
7.4.100.0130.01016.46
7.4.90.0060.01016.59
7.4.80.0130.00619.39
7.4.70.0060.01016.71
7.4.60.0060.00916.68
7.4.50.0090.00616.79
7.4.40.0090.01016.77
7.4.30.0090.01216.81
7.4.00.0070.00715.33
7.3.330.0000.00613.41
7.3.320.0060.00013.30
7.3.310.0040.00416.31
7.3.300.0040.00416.34
7.3.290.0070.00616.41
7.3.280.0080.00916.39
7.3.270.0150.00817.40
7.3.260.0080.01216.52
7.3.250.0110.00816.62
7.3.240.0100.00716.48
7.3.230.0090.00716.77
7.3.210.0030.01416.84
7.3.200.0070.01016.62
7.3.190.0190.00016.32
7.3.180.0040.01116.42
7.3.170.0080.00816.68
7.3.160.0120.00316.65
7.2.330.0080.00816.78
7.2.320.0100.00616.74
7.2.310.0060.01016.71
7.2.300.0100.00716.61
7.2.290.0090.00816.78
7.2.110.0230.00616.50
7.2.60.0180.00717.04
7.2.50.0040.01116.92
7.2.00.0060.00319.73
7.1.200.0070.00415.82
7.1.70.0090.00017.41
7.1.60.0040.00817.50
7.1.50.0040.00717.04
7.1.40.0060.00616.76
7.1.30.0040.00816.69
7.1.20.0060.00617.06
7.1.10.0000.00916.75
7.1.00.0050.00217.19
7.0.200.0000.00716.89
7.0.190.0050.00316.66
7.0.180.0030.00816.37
7.0.170.0050.00316.43
7.0.160.0040.00416.42
7.0.150.0000.00816.45
7.0.140.0030.00616.29
7.0.130.0070.00716.84
7.0.120.0070.00316.72
7.0.110.0040.00816.47
7.0.100.0000.01016.37
7.0.90.0040.00416.66
7.0.80.0000.01016.63
7.0.70.0030.00516.52
7.0.60.0130.00316.28
7.0.50.0000.01316.36
7.0.40.0030.00614.69
7.0.30.0030.00714.94
7.0.20.0040.00414.58
7.0.10.0000.00914.62
7.0.00.0030.00614.60
5.6.300.0000.04220.97
5.6.290.0070.03620.80
5.6.280.0070.04120.87
5.6.270.0030.04021.07
5.6.260.0030.04720.85
5.6.250.0070.04121.03
5.6.240.0000.04821.07
5.6.230.0000.05120.86
5.6.220.0070.04320.96
5.6.210.0030.04521.06
5.6.200.0240.04721.00
5.6.190.0030.05320.87
5.6.180.0060.04420.93
5.6.170.0070.03920.92
5.6.160.0030.04720.78
5.6.150.0140.04820.86
5.6.140.0060.04820.84
5.6.130.0070.04221.01
5.6.120.0070.04320.95
5.6.110.0000.04821.00
5.6.100.0070.04620.94
5.6.90.0000.04520.85
5.6.80.0000.05020.38
5.6.70.0070.03320.41
5.6.60.0060.03520.30
5.6.50.0030.04720.43
5.6.40.0070.03620.22
5.6.30.0030.04220.29
5.6.20.0070.04320.41
5.6.10.0000.04120.18
5.6.00.0030.04420.20

preferences:
64.12 ms | 401 KiB | 5 Q