3v4l.org

run code in 300+ PHP versions simultaneously
<?php $finfo = new finfo(FILEINFO_MIME_TYPE); $postMimeType = $finfo->buffer(file_get_contents('http://img1.wikia.nocookie.net/__cb20130830065058/cardfight/images/7/7a/Smiley-face-1600x1200-wallpaper-775678.jpg')); // If the URL has the file extension included, this will find it $fileExtension = pathinfo('http://img1.wikia.nocookie.net/__cb20130830065058/cardfight/images/7/7a/Smiley-face-1600x1200-wallpaper-775678.jpg', PATHINFO_EXTENSION); // Otherwise, get file extension from the MIME type // This is necessary for image thumbnails to display correctly in the WordPress dashboard media section if ($fileExtension === '') { $fileExtension = basename($postMimeType); $filename = $filename . '.' . $fileExtension; } var_dump($fileExtension);

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.0040.01116.73
8.3.50.0100.00421.99
8.3.40.0070.00718.85
8.3.30.0040.01119.09
8.3.20.0040.00420.71
8.3.10.0040.00422.24
8.3.00.0080.00018.14
8.2.180.0140.01417.25
8.2.170.0120.00322.96
8.2.160.0120.00920.62
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0000.00821.17
8.2.110.0100.00020.96
8.2.100.0000.01117.91
8.2.90.0050.00519.70
8.2.80.0000.00817.97
8.2.70.0040.00417.75
8.2.60.0060.00318.16
8.2.50.0040.00718.07
8.2.40.0050.00320.01
8.2.30.0040.00418.22
8.2.20.0000.00817.75
8.2.10.0040.00418.21
8.2.00.0040.00417.89
8.1.280.0060.00925.92
8.1.270.0070.01024.09
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0070.00322.82
8.1.230.0070.00421.05
8.1.220.0080.00017.88
8.1.210.0000.00818.96
8.1.200.0180.00717.11
8.1.190.0000.00917.23
8.1.180.0040.00418.10
8.1.170.0050.00318.61
8.1.160.0040.00422.00
8.1.150.0000.00819.01
8.1.140.0060.00317.50
8.1.130.0000.00718.02
8.1.120.0040.00417.54
8.1.110.0040.00417.51
8.1.100.0040.00417.50
8.1.90.0000.00717.53
8.1.80.0000.00717.52
8.1.70.0030.00317.52
8.1.60.0000.00917.59
8.1.50.0030.00617.72
8.1.40.0000.00817.59
8.1.30.0000.00817.68
8.1.20.0050.00317.75
8.1.10.0000.00717.71
8.1.00.0040.00417.72
8.0.300.0000.00720.23
8.0.290.0050.00217.00
8.0.280.0000.00818.70
8.0.270.0090.00017.54
8.0.260.0030.00317.44
8.0.250.0000.00717.02
8.0.240.0030.00317.16
8.0.230.0000.00717.10
8.0.220.0040.00417.07
8.0.210.0070.00017.06
8.0.200.0030.00617.13
8.0.190.0000.00917.04
8.0.180.0070.00417.15
8.0.170.0000.00917.07
8.0.160.0000.00717.07
8.0.150.0000.00717.00
8.0.140.0050.00317.13
8.0.130.0000.00613.60
8.0.120.0040.00417.27
8.0.110.0050.00317.18
8.0.100.0030.00517.25
8.0.90.0040.00417.09
8.0.80.0140.00317.21
8.0.70.0000.00717.05
8.0.60.0090.00017.15
8.0.50.0080.00017.25
8.0.30.0120.00817.27
8.0.20.0130.01217.40
8.0.10.0030.00517.08
8.0.00.0070.01317.04
7.4.330.0050.00015.33
7.4.320.0000.00616.65
7.4.300.0060.00016.70
7.4.290.0060.00316.63
7.4.280.0070.00016.73
7.4.270.0050.00316.65
7.4.260.0000.00716.62
7.4.250.0000.00916.91
7.4.240.0050.00316.79
7.4.230.0080.00016.94
7.4.220.0120.00616.76
7.4.210.0100.00716.76
7.4.200.0040.00416.88
7.4.160.0000.01716.59
7.4.150.0110.00717.40
7.4.140.0120.01617.86
7.4.130.0130.01316.80
7.4.120.0140.00616.79
7.4.110.0070.01016.82
7.4.100.0120.00616.61
7.4.90.0030.01516.69
7.4.80.0110.00919.39
7.4.70.0200.00316.89
7.4.60.0090.00916.68
7.4.50.0060.00316.68
7.4.40.0150.00316.73
7.4.30.0120.00416.62
7.4.00.0150.00315.32
7.3.330.0000.00513.34
7.3.320.0050.00013.55
7.3.310.0020.00516.70
7.3.300.0040.00416.41
7.3.290.0100.00716.51
7.3.280.0090.01116.57
7.3.270.0110.00717.40
7.3.260.0060.01216.70
7.3.240.0070.01116.52
7.3.230.0100.00716.41
7.3.210.0060.01216.46
7.3.200.0130.00619.39
7.3.190.0140.00316.66
7.3.180.0090.00916.50
7.3.170.0100.00716.43
7.3.160.0090.00916.48
7.3.120.0100.00715.02
7.2.330.0190.00516.71
7.2.320.0170.00716.61
7.2.310.0060.01216.69
7.2.300.0080.00816.71
7.2.290.0090.00916.70
7.2.60.0030.01016.88
7.2.00.0030.01419.73
7.1.200.0030.00516.08
7.1.100.0070.01018.05
7.1.70.0000.01017.59
7.1.60.0090.01219.25
7.1.50.0130.01017.41
7.1.00.0100.07022.70
7.0.200.0040.00416.75
7.0.140.0100.06722.65
7.0.60.0170.07720.20
7.0.50.0070.06718.12
7.0.40.0170.04020.57
7.0.30.0270.08320.48
7.0.20.0430.07020.54
7.0.10.0100.07020.45
7.0.00.0130.03320.52
5.6.280.0000.07721.56
5.6.210.0000.05720.86
5.6.200.0130.03318.42
5.6.190.0100.08721.04
5.6.180.0270.04721.11
5.6.170.0300.07020.83
5.6.160.0000.06720.94
5.6.150.0070.04718.54
5.6.140.0030.06018.56
5.6.130.0030.04018.55
5.6.120.0100.08321.42
5.6.110.0070.08321.32
5.6.100.0030.08721.28
5.6.90.0100.03721.48
5.6.80.0130.07320.92
5.5.350.0170.08720.81
5.5.340.0000.04718.18
5.5.330.0070.06020.91
5.5.320.3570.04020.77
5.5.310.0270.08720.66
5.5.300.0070.07018.20
5.5.290.0070.06018.45
5.5.280.0030.06021.09
5.5.270.0100.06021.04
5.5.260.0030.05021.08
5.5.250.0070.04020.96
5.5.240.0030.03720.59
5.4.450.0330.06319.89
5.4.440.0230.05320.03
5.4.430.0270.07720.06
5.4.420.0270.05020.01
5.4.410.0300.07019.75
5.4.400.0200.03719.60
5.4.390.0230.07019.73
5.4.380.0230.06719.76
5.4.370.0300.07019.59
5.4.360.0230.07319.57
5.4.350.0270.06319.57
5.4.340.0200.04719.57
5.4.320.0230.05319.59
5.4.310.0270.06719.61
5.4.300.0200.08019.69
5.4.290.0300.04019.67
5.4.280.0130.05319.73
5.4.270.0330.05319.72
5.4.260.0200.04019.71
5.4.250.0430.05319.64
5.4.240.0230.06019.63
5.4.230.0270.07319.55
5.4.220.0200.07719.59
5.4.210.0300.06019.55
5.4.200.0170.08319.71
5.4.190.0270.07019.71
5.4.180.0230.07719.59
5.4.170.0270.06319.58
5.4.160.0370.04319.61
5.4.150.0270.06719.84
5.4.140.0200.05317.02
5.4.130.0270.07017.12
5.4.120.0300.06016.87
5.4.110.0200.07017.10
5.4.100.0200.04016.96
5.4.90.0230.07317.01
5.4.80.0130.06316.99
5.4.70.0200.05316.94
5.4.60.0200.03716.90
5.4.50.0170.06017.02
5.4.40.0200.05717.00
5.4.30.0230.05316.93
5.4.20.0170.04017.01
5.4.10.0300.04316.93
5.4.00.0230.07316.49
5.3.290.0230.05014.86
5.3.280.0230.05315.04
5.3.270.0270.06714.96
5.3.260.0270.07315.10
5.3.250.0170.07715.04
5.3.240.0270.05015.09
5.3.230.0200.06015.07
5.3.220.0230.07315.01
5.3.210.0270.05714.99
5.3.200.0230.04315.01
5.3.190.0230.06014.78
5.3.180.0330.06014.85
5.3.170.0200.05314.98
5.3.160.0230.07715.05
5.3.150.0270.07314.87
5.3.140.0270.07014.91
5.3.130.0300.07015.03
5.3.120.0270.05714.84
5.3.110.0170.04014.88
5.3.100.0300.06714.39
5.3.90.0300.06014.30
5.3.80.0270.05714.45
5.3.70.0230.05714.36
5.3.60.0270.05714.31
5.3.50.0230.07314.30
5.3.40.0230.07014.39
5.3.30.0270.06014.19
5.3.20.0330.05314.19
5.3.10.0200.06714.01
5.3.00.0200.05013.91
5.2.170.0170.06012.31
5.2.160.0270.04312.31
5.2.150.0230.05312.31
5.2.140.0170.06712.31
5.2.130.0230.04312.31
5.2.120.0170.06312.31
5.2.110.0300.06012.31
5.2.100.0170.06312.31
5.2.90.0230.03312.31
5.2.80.0230.03312.31
5.2.70.0130.05312.31
5.2.60.0200.04312.31
5.2.50.0200.03312.31
5.2.40.0170.06012.31
5.2.30.0170.04712.31
5.2.20.0130.06012.31
5.2.10.0170.06012.31
5.2.00.0230.05012.31
5.1.60.0130.05012.31
5.1.50.0170.03312.31
5.1.40.0170.04312.31
5.1.30.0100.04312.31
5.1.20.0200.03012.31
5.1.10.0200.05012.31
5.1.00.0230.03712.31
5.0.50.0070.03712.31
5.0.40.0130.02712.31
5.0.30.0170.03312.31
5.0.20.0100.02712.31
5.0.10.0070.02012.31
5.0.00.0000.05012.31
4.4.90.0070.03012.31
4.4.80.0130.02012.31
4.4.70.0100.03712.31
4.4.60.0100.03312.31
4.4.50.0170.02312.31
4.4.40.0130.03712.31
4.4.30.0070.03312.31
4.4.20.0070.01712.31
4.4.10.0070.03712.31
4.4.00.0100.04712.31
4.3.110.0070.03312.31
4.3.100.0070.02712.31
4.3.90.0130.03712.31
4.3.80.0070.03312.31
4.3.70.0070.02012.31
4.3.60.0100.01712.31
4.3.50.0100.03712.31
4.3.40.0130.04312.31
4.3.30.0030.03312.31
4.3.20.0030.03712.31
4.3.10.0030.03712.31
4.3.00.0100.01712.31

preferences:
36.74 ms | 401 KiB | 5 Q