3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowed_ext = array ( 'bmp', 'jpg', 'jpeg', 'gif', 'pdf' ); $arr = array( 1 => 'file-to-path/thumbs/allowedfile.pdf', 2 => 'file-to-path/thumbs/notallowedfile.psd', 3 => 'file-to-path/project/test/notallowedfile.txt' ); $errors = []; foreach ($arr as $key => $value) { if (!in_array(pathinfo($value, PATHINFO_EXTENSION), $allowed_ext)) { $errors[] = basename($value).' is not allowed.'; unset($arr[$key]); } } print_r($errors); print_r($arr);

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.10.0110.00818.42
8.5.00.0140.00719.92
8.4.160.0120.00923.91
8.4.150.0030.00014.05
8.4.140.0110.01017.50
8.4.130.0110.00718.89
8.4.120.0050.00324.14
8.4.110.0060.00320.67
8.4.100.0040.00517.52
8.4.90.0130.00620.49
8.4.80.0140.00618.93
8.4.70.0140.00718.71
8.4.60.0090.01120.50
8.4.50.0140.00418.57
8.4.40.0070.00417.57
8.4.30.0070.00417.59
8.4.20.0000.00919.48
8.4.10.0060.00319.38
8.3.290.0100.01120.62
8.3.280.0190.01018.44
8.3.270.0100.00916.54
8.3.260.0130.00716.92
8.3.250.0160.00418.89
8.3.240.0090.00717.19
8.3.230.0140.00516.51
8.3.220.0090.00919.05
8.3.210.0120.00716.75
8.3.200.0070.00216.84
8.3.190.0100.00817.17
8.3.180.0060.00218.79
8.3.170.0060.01216.89
8.3.160.0110.00918.27
8.3.150.0030.01616.86
8.3.140.0080.00016.84
8.3.130.0060.00318.52
8.3.120.0040.00419.07
8.3.110.0080.00020.94
8.3.100.0090.00616.48
8.3.90.0000.00826.77
8.3.80.0000.00917.97
8.3.70.0110.00418.18
8.3.60.0090.00618.18
8.3.50.0110.00517.36
8.3.40.0090.00918.63
8.3.30.0110.00318.66
8.3.20.0110.00420.35
8.3.10.0090.00021.63
8.3.00.0050.00319.38
8.2.300.0130.00718.01
8.2.290.0050.00422.34
8.2.280.0130.00618.54
8.2.270.0140.00316.44
8.2.260.0090.00916.97
8.2.250.0040.00416.55
8.2.240.0030.00617.32
8.2.230.0090.00022.58
8.2.220.0070.00424.06
8.2.210.0100.00626.77
8.2.200.0060.00316.50
8.2.190.0150.00316.63
8.2.180.0090.00916.63
8.2.170.0030.01622.96
8.2.160.0030.01020.46
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0000.00819.30
8.2.120.0040.00426.35
8.2.110.0180.00320.52
8.2.100.0080.00417.91
8.2.90.0040.00418.22
8.2.80.0000.00819.14
8.2.70.0000.00817.93
8.2.60.0000.00819.79
8.2.50.0050.00318.07
8.2.40.0040.00418.29
8.2.30.0000.00818.00
8.2.20.0000.00718.04
8.2.10.0050.00317.99
8.2.00.0070.00018.30
8.1.340.0110.00819.91
8.1.330.0110.00821.82
8.1.320.0120.00718.00
8.1.310.0000.00818.30
8.1.300.0150.00420.31
8.1.290.0000.01030.84
8.1.280.0060.00925.92
8.1.270.0070.00023.99
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0080.00419.26
8.1.230.0070.00720.94
8.1.220.0050.00317.74
8.1.210.0060.00318.88
8.1.200.0050.00317.23
8.1.190.0030.00517.11
8.1.180.0040.00418.10
8.1.170.0030.00518.80
8.1.160.0000.00818.72
8.1.150.0000.00718.80
8.1.140.0000.00717.68
8.1.130.0030.00318.79
8.1.120.0030.00317.49
8.1.110.0000.00817.46
8.1.100.0030.00517.42
8.1.90.0080.00017.43
8.1.80.0070.00017.45
8.1.70.0000.00817.36
8.1.60.0000.00817.48
8.1.50.0080.00317.39
8.1.40.0070.00317.49
8.1.30.0040.00417.73
8.1.20.0070.00017.66
8.1.10.0000.00817.51
8.1.00.0040.00417.35
8.0.300.0040.00420.21
8.0.290.0080.00016.63
8.0.280.0050.00318.45
8.0.270.0040.00417.19
8.0.260.0030.00518.95
8.0.250.0030.00316.89
8.0.240.0030.00316.82
8.0.230.0030.00416.96
8.0.220.0000.00816.76
8.0.210.0080.00016.91
8.0.200.0000.00716.84
8.0.190.0030.00516.97
8.0.180.0080.00016.86
8.0.170.0080.00016.95
8.0.160.0000.00716.83
8.0.150.0000.00716.80
8.0.140.0050.00316.86
8.0.130.0030.00313.27
8.0.120.0040.00416.78
8.0.110.0050.00216.85
8.0.100.0030.00416.75
8.0.90.0040.00416.79
8.0.80.0150.00616.83
8.0.70.0000.00716.75
8.0.60.0070.00016.78
8.0.50.0000.00816.75
8.0.30.0110.00917.04
8.0.20.0110.01017.40
8.0.10.0000.00816.88
8.0.00.0120.00916.88
7.4.330.0000.00515.55
7.4.320.0000.00616.50
7.4.300.0100.00016.39
7.4.290.0000.00816.51
7.4.280.0000.00816.36
7.4.270.0000.00716.57
7.4.260.0030.00616.48
7.4.250.0040.00416.57
7.4.240.0030.00316.39
7.4.230.0080.00016.36
7.4.220.0030.00516.52
7.4.210.0030.01316.53
7.4.200.0040.00416.52
7.4.160.0110.00616.42
7.4.150.0060.01217.40
7.4.140.0090.01017.86
7.4.130.0100.01016.34
7.4.120.0130.01016.49
7.4.110.0060.00916.65
7.4.100.0100.01016.54
7.4.90.0070.01116.55
7.4.80.0100.00919.39
7.4.70.0090.00916.44
7.4.60.0090.00616.53
7.4.50.0070.01016.46
7.4.40.0060.00916.18
7.4.00.0040.01214.89
7.3.330.0070.00013.06
7.3.320.0060.00013.11
7.3.310.0030.00316.32
7.3.300.0030.00316.04
7.3.290.0050.01116.31
7.3.280.0110.01116.34
7.3.270.0070.01717.40
7.3.260.0100.01016.34
7.3.250.0110.00916.38
7.3.240.0090.01016.31
7.3.230.0070.01416.63
7.3.210.0100.01016.59
7.3.200.0030.01316.27
7.3.190.0130.00616.22
7.3.180.0090.00616.48
7.3.170.0080.00816.55
7.3.160.0060.01216.31
7.2.330.0040.01616.27
7.2.320.0120.00616.59
7.2.310.0100.00616.74
7.2.300.0100.00716.36
7.2.290.0040.01316.71
7.2.60.0060.00917.01
7.2.10.0230.01117.98
7.2.00.0400.01518.09
7.1.200.0070.00715.73
7.1.130.1040.01316.64
7.1.120.0270.01516.61
7.1.110.0500.00716.27
7.1.100.0440.01316.23
7.1.90.0490.00716.19
7.1.80.0290.01116.43
7.1.70.0080.00815.10
7.1.60.0230.00433.13
7.1.50.0190.01532.65
7.1.40.0190.01332.46
7.1.30.0640.01332.48
7.1.20.0650.01032.67
7.1.10.0130.00614.77
7.1.00.0100.01414.70

preferences:
74.8 ms | 403 KiB | 5 Q