3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** text/plain になるパターン */ // 一時的なファイルを作成する $temp = tmpfile(); // ファイルに2行のCSVデータを書き込む fwrite($temp, "header1,header2\n"); fwrite($temp, "data1,data2\n"); // 一時ファイルのパスを取得する $meta_data = stream_get_meta_data($temp); $path = $meta_data["uri"]; // mime_content_type関数を使用してファイルのMIMEタイプを取得する $ret = mime_content_type($path); var_dump($ret); // string(10) "text/plain" // ファイルを閉じる(一時ファイルは自動的に削除されます) fclose($temp); /** text/csv になるパターン */ // 一時的なファイルを作成する $temp = tmpfile(); // ファイルに3行のCSVデータを書き込む fwrite($temp, "header1,header2\n"); fwrite($temp, "data1,data2\n"); fwrite($temp, "data3,data4\n"); // 一時ファイルのパスを取得する $meta_data = stream_get_meta_data($temp); $path = $meta_data["uri"]; // mime_content_type関数を使用してファイルのMIMEタイプを取得する $ret = mime_content_type($path); var_dump($ret); // string(8) "text/csv" // ファイルを閉じる(一時ファイルは自動的に削除されます) fclose($temp);

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.130.0030.00823.91
8.3.120.0080.00424.74
8.3.110.0070.00722.67
8.3.100.0080.00324.06
8.3.90.0190.00626.77
8.3.80.0000.01322.25
8.3.70.0170.00724.14
8.3.60.0190.01222.13
8.3.50.0160.01023.85
8.3.40.0190.00425.53
8.3.30.0150.00626.54
8.3.20.0090.00028.03
8.3.10.0040.00428.11
8.3.00.0060.00328.03
8.2.250.0080.00422.11
8.2.240.0110.01122.18
8.2.230.0090.00322.58
8.2.220.0190.00637.54
8.2.210.0230.00726.77
8.2.200.0040.00721.88
8.2.190.0120.00622.00
8.2.180.0070.01423.79
8.2.170.0190.00624.12
8.2.160.0060.01226.88
8.2.150.0050.00525.66
8.2.140.0000.01024.66
8.2.130.0070.00726.16
8.2.120.0040.00425.07
8.2.110.0030.01025.26
8.2.100.0040.01223.16
8.2.90.0110.00523.41
8.2.80.0030.00623.29
8.2.70.0030.00923.13
8.2.60.0170.00322.96
8.2.50.0160.00422.83
8.2.40.0150.00522.95
8.2.30.0140.00622.90
8.2.20.0140.00622.83
8.2.10.0150.00622.75
8.2.00.0130.00722.67
8.1.300.0170.00324.14
8.1.290.0070.00730.84
8.1.280.0080.01925.92
8.1.270.0030.00626.33
8.1.260.0080.00326.35
8.1.250.0080.00028.09
8.1.240.0080.00628.05
8.1.230.0140.00325.04
8.1.220.0050.00524.71
8.1.210.0030.00823.08
8.1.200.0130.00322.48
8.1.190.0060.01422.28
8.1.180.0170.00322.28
8.1.170.0140.00622.49
8.1.160.0090.01122.46
8.1.150.0110.00822.50
8.1.140.0170.00322.42
8.1.130.0140.00522.44
8.1.120.0170.00222.54
8.1.110.0130.00722.54
8.1.100.0140.00622.49
8.1.90.0130.00722.40
8.1.80.0090.01222.40
8.1.70.0150.00622.33
8.1.60.0170.00322.77
8.1.50.0150.00522.38
8.1.40.0120.00722.49
8.1.30.0130.00722.65
8.1.20.0160.00522.62
8.1.10.0150.00622.62
8.1.00.0100.01022.63
8.0.300.0030.00923.76
8.0.290.0000.01021.88
8.0.280.0090.01021.57
8.0.270.0100.00921.65
8.0.260.0120.00621.75
8.0.250.0110.00721.71
8.0.240.0130.00521.49
8.0.230.0120.00621.66
8.0.220.0160.00221.62
8.0.210.0110.00621.70
8.0.200.0130.00521.61
8.0.190.0150.00321.71
8.0.180.0150.00421.58
8.0.170.0130.00521.71
8.0.160.0110.00721.69
8.0.150.0110.00821.57
8.0.140.0140.00421.56
8.0.130.0150.00421.65
8.0.120.0110.00721.65
8.0.110.0120.00621.66
8.0.100.0120.00621.75
8.0.90.0140.00421.75
8.0.80.0140.00521.47
8.0.70.0130.00621.61
8.0.60.0100.00621.96
8.0.50.0120.00521.67
8.0.30.0090.01021.66
8.0.20.0130.00521.71
8.0.10.0090.00921.79
8.0.00.0140.00521.91
7.4.330.0090.00717.28
7.4.320.0130.00520.75
7.4.300.0120.00620.83
7.4.290.0080.00920.70
7.4.280.0120.00720.71
7.4.270.0120.00520.75
7.4.260.0110.00620.79
7.4.250.0110.00720.63
7.4.240.0130.00420.75
7.4.230.0110.00720.67
7.4.220.0120.00620.62
7.4.210.0100.00820.70
7.4.200.0110.00620.74
7.4.190.0160.00320.83
7.4.180.0120.00620.78
7.4.160.0090.00920.75
7.4.150.0090.01020.75
7.4.140.0090.00920.66
7.4.130.0140.00520.70
7.4.120.0150.00320.74
7.4.110.0130.00520.71
7.4.100.0110.00620.92
7.4.90.0100.00820.71
7.4.80.0110.00820.71
7.4.70.0150.00420.58
7.4.60.0120.00520.71
7.4.50.0110.00720.58
7.4.40.0120.00520.54
7.4.30.0110.00620.67
7.4.20.0120.00620.50
7.4.10.0120.00620.66
7.4.00.0120.00620.67
7.3.330.0110.00720.28
7.3.320.0130.00420.15
7.3.310.0110.00620.36
7.3.300.0150.00320.16
7.3.290.0110.00520.11
7.3.280.0090.00920.23
7.3.270.0070.01220.40
7.3.260.0120.00820.16
7.3.250.0090.00820.29
7.3.240.0100.00820.15
7.3.230.0160.00420.29
7.3.220.0080.00920.03
7.3.210.0090.00920.24
7.3.200.0140.00320.33
7.3.190.0140.00420.16
7.3.180.0120.00520.24
7.3.170.0130.00620.07
7.3.160.0110.00620.28
7.3.150.0130.00520.33
7.3.140.0140.00520.33
7.3.130.0120.00620.28
7.3.120.0140.00320.16
7.3.110.0130.00620.16
7.3.100.0110.00720.20
7.3.90.0110.00820.46
7.3.80.0120.00520.33
7.3.70.0100.00820.25
7.3.60.0100.00720.36
7.3.50.0130.00520.49
7.3.40.0090.00820.29
7.3.30.0160.00220.28
7.3.20.0150.00320.36
7.3.10.0140.00620.17
7.3.00.0160.00220.17
7.2.340.0130.00520.38
7.2.330.0090.00820.32
7.2.320.0110.00620.29
7.2.310.0110.00520.25
7.2.300.0100.00720.21
7.2.290.0110.00720.29
7.2.280.0110.00620.12
7.2.270.0080.00820.33
7.2.260.0160.00120.37
7.2.250.0070.00920.33
7.2.240.0120.00620.20
7.2.230.0130.00420.33
7.2.220.0110.00620.20
7.2.210.0110.00620.12
7.2.200.0120.00520.42
7.2.190.0120.00520.40
7.2.180.0090.00920.42
7.2.170.0120.00620.50
7.2.160.0150.00220.54
7.2.150.0180.00720.33
7.2.140.0110.00820.54
7.2.130.0150.00420.54
7.2.120.0140.00420.58
7.2.110.0120.00620.42
7.2.100.0130.00520.25
7.2.90.0180.00220.20
7.2.80.0090.00920.42
7.2.70.0110.00920.29
7.2.60.0100.00720.38
7.2.50.0100.00920.50
7.2.40.0120.00720.54
7.2.30.0220.00420.42
7.2.20.0180.00520.46
7.2.10.0130.00620.42
7.2.00.0190.00020.45
7.1.330.0130.00417.92
7.1.320.0110.00618.13
7.1.310.0130.00418.08
7.1.300.0130.00317.79
7.1.290.0120.00417.96
7.1.280.0140.00218.04
7.1.270.0110.01118.08
7.1.260.0100.00617.96
7.1.250.0130.00317.71
7.1.240.0090.00818.08
7.1.230.0130.00517.75
7.1.220.0060.01117.96
7.1.210.0120.00417.96
7.1.200.0120.00418.04
7.1.190.0120.00517.96
7.1.180.0120.00417.88
7.1.170.0080.00817.83
7.1.160.0120.00517.88
7.1.150.0190.00517.92
7.1.140.0130.01118.00
7.1.130.0080.00917.79
7.1.120.0100.00718.04
7.1.110.0140.00318.21
7.1.100.0110.00517.88
7.1.90.0090.00718.13
7.1.80.0110.00518.17
7.1.70.0130.00518.00
7.1.60.0130.00517.96
7.1.50.0210.00217.96
7.1.40.0130.00418.25
7.1.30.0110.00618.08
7.1.20.0080.00918.13
7.1.10.0140.00218.08
7.1.00.0150.00317.88
7.0.330.0130.00317.58
7.0.320.0140.00317.58
7.0.310.0110.00617.79
7.0.300.0130.00317.58
7.0.290.0120.00417.67
7.0.280.0100.00617.58
7.0.270.0180.00417.54
7.0.260.0180.00317.71
7.0.250.0110.00617.71
7.0.240.0110.00517.71
7.0.230.0090.00617.83
7.0.220.0120.00517.75
7.0.210.0110.00517.58
7.0.200.0110.00417.50
7.0.190.0090.00717.58
7.0.180.0110.00617.71
7.0.170.0200.00317.75
7.0.160.0090.00717.58
7.0.150.0150.00117.63
7.0.140.0100.00717.67
7.0.130.0110.00617.83
7.0.120.0130.00317.79
7.0.110.0120.00417.75
7.0.100.0070.00917.42
7.0.90.0140.00217.58
7.0.80.0150.00117.54
7.0.70.0130.00317.46
7.0.60.0110.00517.42
7.0.50.0150.00617.33
7.0.40.0250.00117.71
7.0.30.0080.00717.42
7.0.20.0110.00517.33
7.0.10.0120.00417.58
7.0.00.0090.00817.42
5.6.400.0120.00518.08
5.6.390.0120.00218.08
5.6.380.0110.00318.08
5.6.370.0120.00318.04
5.6.360.0090.00618.21
5.6.350.0130.00118.00
5.6.340.0130.00318.13
5.6.330.0100.00417.96
5.6.320.0100.00618.17
5.6.310.0110.00418.00
5.6.300.0100.00517.92
5.6.290.0090.00618.00
5.6.280.0090.00518.17
5.6.270.0110.00418.17
5.6.260.0110.00418.13
5.6.250.0080.00618.04
5.6.240.0040.01018.00
5.6.230.0080.00518.25
5.6.220.0120.00218.17
5.6.210.0100.00518.04
5.6.200.0100.00518.08
5.6.190.0080.00618.21
5.6.180.0090.00718.29
5.6.170.0050.01018.29
5.6.160.0070.00718.38
5.6.150.0090.00518.25
5.6.140.0110.00318.17
5.6.130.0110.00318.29
5.6.120.0110.00318.00
5.6.110.0110.00318.17
5.6.100.0100.00418.04
5.6.90.0070.00618.17
5.6.80.0100.00418.13
5.6.70.0100.00418.21
5.6.60.0080.00618.25
5.6.50.0110.00418.13
5.6.40.0090.00618.00
5.6.30.0110.00318.00
5.6.20.0100.00318.00
5.6.10.0090.00417.96
5.6.00.0110.00417.96
5.5.380.0090.00517.96
5.5.370.0100.00518.00
5.5.360.0120.00318.00
5.5.350.0130.00217.88
5.5.340.0110.00417.83
5.5.330.0060.00817.75
5.5.320.0070.00717.92
5.5.310.0070.00717.75
5.5.300.0100.00517.96
5.5.290.0110.00417.96
5.5.280.0090.00517.71
5.5.270.0100.00517.79
5.5.260.0100.00517.75
5.5.250.0070.00817.83
5.5.240.0090.00517.88
5.5.230.0100.00517.88
5.5.220.0110.00318.00
5.5.210.0100.00317.92
5.5.200.0090.00517.79
5.5.190.0080.00617.92
5.5.180.0110.00417.83
5.5.170.0070.00617.79
5.5.160.0120.00217.88
5.5.150.0090.00517.67
5.5.140.0100.00317.79
5.5.130.0120.00317.71
5.5.120.0070.00617.83
5.5.110.0110.00317.75
5.5.100.0110.00317.96
5.5.90.0090.00517.96
5.5.80.0050.00917.88
5.5.70.0080.00617.83
5.5.60.0090.00517.88
5.5.50.0050.00917.88
5.5.40.0100.00417.88
5.5.30.0080.00617.92
5.5.20.0090.00517.96
5.5.10.0100.00417.92
5.5.00.0080.00617.58
5.4.450.0100.00116.52
5.4.440.0090.00316.52
5.4.430.0090.00416.52
5.4.420.0080.00316.52
5.4.410.0070.00416.52
5.4.400.0100.00116.52
5.4.390.0050.00616.52
5.4.380.0080.00416.52
5.4.370.0090.00316.52
5.4.360.0040.00716.52
5.4.350.0080.00416.52
5.4.340.0060.00616.52
5.4.330.0100.00316.52
5.4.320.0060.00616.52
5.4.310.0090.00316.52
5.4.300.0100.00116.52
5.4.290.0080.00216.52
5.4.280.0070.00416.52
5.4.270.0030.00816.52
5.4.260.0070.00516.52
5.4.250.0080.00416.52
5.4.240.0090.00316.52
5.4.230.0070.00416.52
5.4.220.0070.00416.52
5.4.210.0080.00416.52
5.4.200.0080.00316.52
5.4.190.0080.00416.52
5.4.180.0070.00516.52
5.4.170.0050.00616.52
5.4.160.0060.00516.52
5.4.150.0020.00916.52
5.4.140.0050.00616.52
5.4.130.0080.00216.52
5.4.120.0070.00416.52
5.4.110.0090.00316.52
5.4.100.0060.00516.52
5.4.90.0040.00616.52
5.4.80.0090.00116.52
5.4.70.0110.00016.52
5.4.60.0030.00716.52
5.4.50.0050.00516.52
5.4.40.0040.00716.52
5.4.30.0090.00116.52
5.4.20.0070.00416.52
5.4.10.0070.00416.52
5.4.00.0090.00216.52
5.3.290.0050.00716.52
5.3.280.0100.00116.52
5.3.270.0090.00316.52
5.3.260.0040.00816.52
5.3.250.0090.00416.52
5.3.240.0050.00516.52
5.3.230.0040.00716.52
5.3.220.0040.00816.52
5.3.210.0070.00516.52
5.3.200.0100.00116.52
5.3.190.0080.00316.52
5.3.180.0090.00216.52
5.3.170.0120.00116.52
5.3.160.0100.00116.52
5.3.150.0070.00416.52
5.3.140.0070.00516.52
5.3.130.0080.00416.52
5.3.120.0050.00616.52
5.3.110.0080.00316.52
5.3.100.0070.00316.52
5.3.90.0080.00216.52
5.3.80.0080.00216.52
5.3.70.0080.00216.52
5.3.60.0030.00816.52
5.3.50.0070.00416.52
5.3.40.0080.00216.52
5.3.30.0050.00516.52
5.3.20.0080.00216.52
5.3.10.0090.00116.52
5.3.00.0070.00216.52
5.2.170.0080.00116.52
5.2.160.0070.00216.52
5.2.150.0060.00216.52
5.2.140.0040.00416.52
5.2.130.0060.00316.52
5.2.120.0060.00216.52
5.2.110.0020.00716.52
5.2.100.0080.00116.52
5.2.90.0030.00516.52
5.2.80.0070.00216.52
5.2.70.0040.00516.52
5.2.60.0050.00316.52
5.2.50.0070.00216.52
5.2.40.0050.00316.52
5.2.30.0070.00116.52
5.2.20.0070.00116.52
5.2.10.0060.00316.52
5.2.00.0040.00416.52
5.1.60.0040.00316.52
5.1.50.0010.00616.52
5.1.40.0040.00316.52
5.1.30.0040.00416.52
5.1.20.0060.00216.52
5.1.10.0040.00416.52
5.1.00.0060.00216.52
5.0.50.0020.00416.52
5.0.40.0050.00216.52
5.0.30.0010.00516.52
5.0.20.0030.00316.52
5.0.10.0050.00116.52
5.0.00.0000.00616.52
4.4.90.0010.00316.52
4.4.80.0040.00016.52
4.4.70.0030.00116.52
4.4.60.0020.00116.52
4.4.50.0020.00116.52
4.4.40.0010.00216.52
4.4.30.0020.00216.52
4.4.20.0020.00216.52
4.4.10.0030.00116.52
4.4.00.0010.00216.52
4.3.110.0010.00216.52
4.3.100.0000.00416.52
4.3.90.0020.00116.52
4.3.80.0020.00216.52
4.3.70.0000.00416.52
4.3.60.0010.00316.52
4.3.50.0030.00116.52
4.3.40.0040.00016.52
4.3.30.0020.00116.52
4.3.20.0020.00116.52
4.3.10.0030.00016.52
4.3.00.0020.00116.52

preferences:
44.55 ms | 403 KiB | 5 Q