3v4l.org

run code in 300+ PHP versions simultaneously
<?php$filename = 'test.txt'; $somecontent = "Добавить это к файлу\n"; // Вначале давайте убедимся, что файл существует и доступен для записи. if (is_writable($filename)) { // В нашем примере мы открываем $filename в режиме "дописать в конец". // Таким образом, смещение установлено в конец файла и // наш $somecontent допишется в конец при использовании fwrite(). if (!$handle = fopen($filename, 'a')) { echo "Не могу открыть файл ($filename)"; exit; } // Записываем $somecontent в наш открытый файл. if (fwrite($handle, $somecontent) === FALSE) { echo "Не могу произвести запись в файл ($filename)"; exit; } echo "Ура! Записали ($somecontent) в файл ($filename)"; fclose($handle); } else { echo "Файл $filename недоступен для записи"; }

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.4.20.0080.01217.64
8.4.10.0060.00319.35
8.3.150.0140.00416.82
8.3.140.0000.00816.45
8.3.130.0060.00316.55
8.3.120.0040.00418.73
8.3.110.0040.00720.94
8.3.100.0030.00616.48
8.3.90.0120.00320.26
8.3.80.0090.00018.43
8.3.70.0140.00318.18
8.3.60.0070.00716.63
8.3.50.0140.00717.25
8.3.40.0120.00418.59
8.3.30.0120.00318.45
8.3.20.0040.00418.52
8.3.10.0080.00020.36
8.3.00.0080.00019.18
8.2.260.0120.00318.12
8.2.250.0030.00616.57
8.2.240.0060.00318.71
8.2.230.0000.01022.58
8.2.220.0000.00824.06
8.2.210.0040.00426.77
8.2.200.0070.00316.44
8.2.190.0140.00016.58
8.2.180.0100.01016.38
8.2.170.0110.00422.96
8.2.160.0070.00720.39
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0030.00320.98
8.2.110.0090.00021.09
8.2.100.0110.00017.61
8.2.90.0000.00819.88
8.2.80.0040.00420.39
8.2.70.0050.00317.50
8.2.60.0040.00417.38
8.2.50.0050.00318.07
8.2.40.0080.00018.16
8.2.30.0000.00817.96
8.2.20.0000.01117.55
8.2.10.0000.00717.53
8.2.00.0040.00417.54
8.1.310.0080.00018.29
8.1.300.0000.00818.48
8.1.290.0050.00518.88
8.1.280.0060.01525.92
8.1.270.0070.00023.99
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0060.00322.14
8.1.230.0040.00722.73
8.1.220.0060.00317.74
8.1.210.0000.00818.83
8.1.200.0090.00017.00
8.1.190.0080.00016.97
8.1.180.0000.00818.10
8.1.170.0000.00918.58
8.1.160.0060.00318.71
8.1.150.0060.00318.48
8.1.140.0040.00417.21
8.1.130.0030.00317.62
8.1.120.0050.00317.25
8.1.110.0080.00017.29
8.1.100.0080.00017.34
8.1.90.0050.00217.30
8.1.80.0040.00417.22
8.1.70.0000.00717.21
8.1.60.0080.00017.45
8.1.50.0000.00717.37
8.1.40.0000.00817.37
8.1.30.0090.00017.43
8.1.20.0000.00717.39
8.1.10.0030.00517.41
8.1.00.0000.00817.33
8.0.300.0070.00020.07
8.0.290.0000.00716.75
8.0.280.0070.00018.41
8.0.270.0040.00417.19
8.0.260.0000.00616.72
8.0.250.0050.00316.82
8.0.240.0040.00416.72
8.0.230.0070.00016.81
8.0.220.0040.00416.70
8.0.210.0030.00316.61
8.0.200.0000.00616.89
8.0.190.0030.00516.72
8.0.180.0030.00316.75
8.0.170.0030.00616.62
8.0.160.0030.00516.65
8.0.150.0030.00716.76
8.0.140.0000.00716.59
8.0.130.0050.00013.47
8.0.120.0040.00416.66
8.0.110.0080.00016.61
8.0.100.0000.00816.72
8.0.90.0050.00516.77
8.0.80.0070.00716.80
8.0.70.0040.00316.65
8.0.60.0000.00716.57
8.0.50.0000.00816.76
8.0.30.0150.00617.21
8.0.20.0140.00617.05
8.0.10.0000.00716.78
8.0.00.0140.01716.54
7.4.330.0050.00012.84
7.4.320.0000.00616.48
7.4.300.0000.00616.35
7.4.290.0050.00216.46
7.4.280.0110.00416.38
7.4.270.0040.00416.37
7.4.260.0000.00513.14
7.4.250.0040.00416.27
7.4.240.0000.00716.44
7.4.230.0000.00616.57
7.4.220.0130.01016.45
7.4.210.0070.00716.53
7.4.200.0000.00716.46
7.4.190.0000.00716.50
7.4.160.0030.01216.21
7.4.150.0090.00916.25
7.4.140.0100.00716.39
7.4.130.0120.00916.26
7.4.120.0130.00316.34
7.4.110.0030.01616.24
7.4.100.0160.00016.52
7.4.90.0160.00616.40
7.4.80.0100.01019.39
7.4.70.0060.01216.29
7.4.60.0110.00316.25
7.4.50.0040.00416.21
7.4.40.0070.01016.26
7.4.30.0130.00316.46
7.3.330.0050.00213.15
7.3.320.0030.00313.05
7.3.310.0000.00616.17
7.3.300.0030.00316.14
7.3.290.0050.01116.16
7.3.280.0080.00616.11
7.3.270.0130.00616.59
7.3.260.0150.00316.20
7.3.250.0110.00616.29
7.3.240.0060.00916.07
7.3.230.0140.00916.43
7.3.210.0140.00416.32
7.3.200.0110.00716.34
7.3.190.0060.01316.37
7.3.180.0040.01116.43
7.3.170.0060.01016.43
7.3.160.0170.00316.24
7.2.330.0070.01016.31
7.2.320.0070.01216.31
7.2.310.0060.01216.31
7.2.300.0090.01416.54
7.2.290.0140.00416.64
5.4.110.0170.02716.39
5.4.100.0100.05016.41
5.4.90.0000.04016.39
5.4.80.0030.04316.32
5.4.70.0000.04716.52
5.4.60.0070.05716.50
5.4.50.0030.06016.39
5.4.40.0100.07016.40
5.4.30.0100.03716.44
5.4.20.0030.03716.43
5.4.10.0100.07016.43
5.4.00.0130.07015.82
5.3.290.0030.03714.57
5.3.280.0000.04014.52
5.3.270.0130.03314.42
5.3.260.0070.03314.61
5.3.250.0000.03714.54
5.3.240.0100.03014.54
5.3.230.0070.03314.57
5.3.220.0030.04714.35
5.3.210.0030.03714.57
5.3.200.0030.04714.54
5.3.190.0100.04014.50
5.3.180.0000.04314.48
5.3.170.0170.05014.50
5.3.160.0070.04014.52
5.3.150.0100.07714.34
5.3.140.0100.07314.49
5.3.130.0070.04714.43
5.3.120.0130.06714.51
5.3.110.0070.06714.47
5.3.100.0000.08013.96
5.3.90.0030.07714.04
5.3.80.0000.05313.95
5.3.70.0030.07313.95
5.3.60.0100.07313.97
5.3.50.0170.06314.03
5.3.40.0070.06713.89
5.3.30.0070.04713.84
5.3.20.0130.04013.52
5.3.10.0070.06013.67
5.3.00.0100.06713.57

preferences:
28.98 ms | 403 KiB | 5 Q