3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests=[ 'Non-Images Only'=>'filename 1 (https://example.com/test.exe)', 'Mixed-Type'=>'filename 1 (https://example.com/test.pdf), filename 2 (https://example.com/cool_image.jpg), filename 3 (https://example.com/other-file.docx), filename 4 (https://example.com/nice_image.png)', 'No Files'=>'filename 1 (), filename 2 ()', 'Images-Only'=>'filename 1 (https://example.com/another.png), filename 2 (https://example.com/cool_image.jpg))']; $image_pattern='~\.(?:png|gif|jpe?g|bmp)\),?$~im'; $non_image_pattern='~\.(?:(?:png|gif|jpe?g|bmp)(*SKIP)(*FAIL)|[^.)]+)\),?$~im'; foreach($tests as $type=>$string){ echo "\t\tAssessing:\n---\n"; echo "$string\n---\n"; echo "Expecting: $type\n"; echo "Assessed as: "; $has_image=preg_match($image_pattern,$string); $has_non_image=preg_match($non_image_pattern,$string); if($has_image){ if($has_non_image){ echo "Mix of image and non-image files"; }else{ echo "Purely image files"; } }else{ if($has_non_image){ echo "Purely non-image files"; }else{ echo "No files recognized"; } } echo "\n----------------------------------------------------\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.5.00.0120.01119.87
8.4.150.0020.00014.05
8.4.140.0120.01117.65
8.4.130.0110.00917.87
8.4.120.0060.00320.29
8.4.110.0050.00519.09
8.4.100.0110.00918.13
8.4.90.0120.00917.80
8.4.80.0110.00818.14
8.4.70.0070.00219.62
8.4.60.0150.00718.86
8.4.50.0120.00719.93
8.4.40.0090.00919.57
8.4.30.0080.00817.73
8.4.20.0100.01019.32
8.4.10.0080.00017.88
8.3.280.0120.00818.66
8.3.270.0160.00516.60
8.3.260.0110.01016.75
8.3.250.0120.00819.12
8.3.240.0070.00916.87
8.3.230.0130.00816.79
8.3.220.0090.01116.54
8.3.210.0100.00916.67
8.3.200.0050.00416.96
8.3.190.0110.00918.45
8.3.180.0100.00818.77
8.3.170.0050.00316.54
8.3.160.0100.00717.49
8.3.150.0040.00416.99
8.3.140.0040.00416.74
8.3.130.0080.00816.66
8.3.120.0030.00620.84
8.3.110.0090.00020.94
8.3.100.0030.00524.06
8.3.90.0040.01126.77
8.3.80.0040.00717.97
8.3.70.0100.00618.56
8.3.60.0090.01218.32
8.3.50.0080.00816.63
8.3.40.0120.00918.88
8.3.30.0040.01118.84
8.3.20.0070.00021.92
8.3.10.0040.00421.76
8.3.00.0120.00319.56
8.2.290.0120.00620.58
8.2.280.0030.00518.31
8.2.270.0090.00917.24
8.2.260.0090.00616.98
8.2.250.0030.00616.65
8.2.240.0000.00919.16
8.2.230.0080.00422.58
8.2.220.0030.00637.54
8.2.210.0030.00526.77
8.2.200.0030.00616.50
8.2.190.0110.00716.63
8.2.180.0120.00916.56
8.2.170.0000.01522.96
8.2.160.0110.00420.21
8.2.150.0130.00625.66
8.2.140.0050.00324.66
8.2.130.0000.00820.51
8.2.120.0120.00326.35
8.2.110.0000.00920.52
8.2.100.0080.00418.22
8.2.90.0040.00418.22
8.2.80.0030.00917.97
8.2.70.0000.00817.80
8.2.60.0040.00418.22
8.2.50.0050.00318.10
8.2.40.0070.00020.42
8.2.30.0040.00420.95
8.2.20.0040.00418.00
8.2.10.0080.00018.14
8.2.00.0050.00218.10
8.1.330.0080.01016.61
8.1.320.0150.00416.25
8.1.310.0150.00418.50
8.1.300.0100.00018.77
8.1.290.0050.00530.84
8.1.280.0130.00325.92
8.1.270.0080.00024.66
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00320.66
8.1.230.0070.00420.91
8.1.220.0030.00517.78
8.1.210.0040.00418.83
8.1.200.0070.00317.47
8.1.190.0070.00317.38
8.1.180.0080.00019.05
8.1.170.0030.00518.79
8.1.160.0040.00418.94
8.1.150.0000.00720.30
8.1.140.0000.00817.66
8.1.130.0070.00019.05
8.1.120.0030.00717.63
8.1.110.0080.00017.54
8.1.100.0000.00817.61
8.1.90.0040.00417.60
8.1.80.0050.00217.58
8.1.70.0000.00717.63
8.1.60.0000.00817.66
8.1.50.0000.00917.61
8.1.40.0040.00417.59
8.1.30.0000.00817.86
8.1.20.0040.00417.86
8.1.10.0090.00017.65
8.1.00.0040.00417.61
8.0.300.0000.00719.76
8.0.290.0000.00716.75
8.0.280.0080.00018.48
8.0.270.0070.00017.29
8.0.260.0060.00316.89
8.0.250.0050.00217.14
8.0.240.0080.00017.18
8.0.230.0000.00717.17
8.0.220.0030.00317.09
8.0.210.0030.00316.99
8.0.200.0000.00717.14
8.0.190.0080.00017.12
8.0.180.0000.00816.96
8.0.170.0060.00317.04
8.0.160.0050.00317.04
8.0.150.0000.00716.99
8.0.140.0000.00816.90
8.0.130.0050.00013.41
8.0.120.0040.00416.91
8.0.110.0000.00717.02
8.0.100.0040.00416.93
8.0.90.0000.00816.93
8.0.80.0080.00817.08
8.0.70.0040.00416.95
8.0.60.0000.00817.04
8.0.50.0050.00317.08
8.0.30.0070.01217.23
8.0.20.0110.00917.48
8.0.10.0070.00017.07
8.0.00.0050.01316.99
7.4.330.0000.00515.55
7.4.320.0000.00616.82
7.4.300.0000.00716.68
7.4.290.0000.00716.63
7.4.280.0000.00716.86
7.4.270.0080.00016.74
7.4.260.0070.00016.62
7.4.250.0040.00416.84
7.4.240.0000.00816.74
7.4.230.0030.00416.57
7.4.220.0050.00216.91
7.4.210.0130.00316.80
7.4.200.0030.00316.57
7.4.160.0090.00816.65
7.4.150.0120.01217.40
7.4.140.0070.01217.86
7.4.130.0130.00516.78
7.4.120.0100.00916.77
7.4.110.0130.01216.73
7.4.100.0140.01016.73
7.4.90.0100.01016.78
7.4.80.0060.01419.39
7.4.70.0090.01016.70
7.4.60.0060.00916.51
7.4.50.0100.00716.69
7.4.40.0080.00816.73
7.4.00.0090.00915.07
7.3.330.0060.00013.37
7.3.320.0000.00613.23
7.3.310.0040.00416.35
7.3.300.0070.00016.48
7.3.290.0000.00716.51
7.3.280.0080.00816.46
7.3.270.0150.01117.40
7.3.260.0140.00416.56
7.3.240.0110.00816.57
7.3.230.0040.01216.88
7.3.210.0140.00416.55
7.3.200.0100.01016.78
7.3.190.0100.00716.59
7.3.180.0080.00816.38
7.3.170.0100.00616.68
7.3.160.0090.00616.76
7.3.120.0080.00814.97
7.3.110.0090.00914.88
7.3.100.0040.00914.79
7.3.90.0050.00814.90
7.3.80.0060.01015.17
7.3.70.0030.01114.96
7.3.60.0080.00614.99
7.3.50.0080.00714.91
7.3.40.0050.00814.95
7.3.30.0060.00715.02
7.3.20.0050.01016.80
7.3.10.0120.00316.82
7.3.00.0070.00716.66
7.2.330.0070.01016.64
7.2.320.0100.00716.92
7.2.310.0030.01316.73
7.2.300.0040.01416.88
7.2.290.0060.01216.77
7.2.250.0080.01115.18
7.2.240.0110.00715.21
7.2.230.0070.00815.10
7.2.220.0000.01215.31
7.2.210.0090.00715.25
7.2.200.0060.00715.16
7.2.190.0030.01015.20
7.2.180.0070.01014.93
7.2.170.0020.01215.27
7.2.160.0030.01015.38
7.2.150.0030.01317.13
7.2.140.0060.00916.93
7.2.130.0000.01517.18
7.2.120.0120.00316.88
7.2.110.0080.00416.88
7.2.100.0040.00816.88
7.2.90.0030.01417.09
7.2.80.0070.00716.99
7.2.70.0100.00717.21
7.2.60.0060.00917.11
7.2.50.0060.00816.98
7.2.40.0090.00617.22
7.2.30.0070.00717.00
7.2.20.0090.01218.50
7.2.10.0060.01218.47
7.2.00.0070.01418.57
7.1.330.0020.01416.00
7.1.320.0060.00816.13
7.1.310.0050.01016.08
7.1.300.0070.00615.86
7.1.290.0050.00915.83
7.1.280.0100.00515.98
7.1.270.0040.01015.98
7.1.260.0080.00615.98
7.1.250.0070.01015.97
7.1.200.0040.00816.18
7.1.140.0100.01418.93
7.1.130.0090.01418.64
7.1.120.0090.01318.77
7.1.110.0090.00718.05
7.1.100.0080.01418.31
7.1.90.0070.01618.19
7.1.80.0090.01418.11
7.1.70.0130.01117.48
7.1.60.0270.01735.22
7.1.50.0230.01234.86
7.1.40.0290.02134.70
7.1.30.0220.01734.72
7.1.20.0250.01234.97
7.1.10.0120.01016.55
7.1.00.0110.01316.99

preferences:
173.76 ms | 403 KiB | 5 Q