3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = new \SplTempFileObject(); for ($i = 0; $i < 100; $i++) { $file->fwrite("Foo\t$i\n"); } // Puts the internal pointer at the start of line index 50 (0-based indexing) $file->seek(50); // Read the internal pointer value = 50 var_dump($file->key()); // Read the next available line (which is line at index 50) var_dump($file->fgets()); // Read the internal pointer value = 50 (end of the line now) var_dump($file->key()); // Read the next available line (which is line at index 51 as there's nothing more on line 50) var_dump($file->fgets()); // Read the internal pointer value = 51 (end of the line) var_dump($file->key());

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.70.0060.01018.18
8.3.60.0090.00918.43
8.3.50.0180.00419.94
8.3.40.0150.00019.18
8.3.30.0100.01318.45
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0150.00026.16
8.2.190.0120.00618.43
8.2.180.0170.00325.92
8.2.170.0070.00718.96
8.2.160.0100.00322.96
8.2.150.0000.00725.66
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0070.00019.66
8.2.110.0050.00520.51
8.2.100.0040.00717.78
8.2.90.0030.00718.95
8.2.80.0060.00317.97
8.2.70.0040.00417.50
8.2.60.0000.00817.63
8.2.50.0000.00818.07
8.2.40.0030.00519.66
8.2.30.0080.00017.77
8.2.20.0080.00019.53
8.2.10.0000.00717.86
8.2.00.0030.00519.21
8.1.280.0160.00325.92
8.1.270.0000.00723.99
8.1.260.0090.00026.35
8.1.250.0030.00628.09
8.1.240.0060.01623.77
8.1.230.0120.00022.62
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0000.00817.50
8.1.180.0040.00418.10
8.1.170.0040.00418.90
8.1.160.0040.00418.92
8.1.150.0000.00718.62
8.1.140.0040.00417.41
8.1.130.0000.00818.85
8.1.120.0040.00417.41
8.1.110.0040.00417.31
8.1.100.0060.00317.43
8.1.90.0040.00417.43
8.1.80.0000.00917.47
8.1.70.0000.00717.38
8.1.60.0030.00517.53
8.1.50.0080.00017.42
8.1.40.0040.00417.51
8.1.30.0060.00317.61
8.1.20.0040.00417.54
8.1.10.0000.00717.50
8.1.00.0000.00717.54
8.0.300.0040.00418.77
8.0.290.0000.00916.75
8.0.280.0030.00318.61
8.0.270.0030.00316.86
8.0.260.0000.00618.54
8.0.250.0030.00316.91
8.0.240.0040.00417.01
8.0.230.0030.00316.96
8.0.220.0050.00316.86
8.0.210.0040.00416.88
8.0.200.0030.00316.91
8.0.190.0000.00716.98
8.0.180.0000.00716.91
8.0.170.0060.00316.93
8.0.160.0040.00416.82
8.0.150.0050.00216.87
8.0.140.0040.00416.90
8.0.130.0000.00513.32
8.0.120.0070.00314.54
8.0.110.0150.00016.96
8.0.100.0100.00516.83
8.0.90.0100.00716.76
8.0.80.0130.00316.76
8.0.70.0120.00516.75
8.0.60.0050.01016.74
8.0.50.0130.00316.78
8.0.30.0050.01016.82
8.0.20.0110.00516.80
8.0.10.0050.00413.68
8.0.00.0050.00413.67
7.4.330.0060.00015.55
7.4.320.0000.00616.59
7.4.300.0060.00016.48
7.4.290.0030.00516.41
7.4.280.0040.00416.56
7.4.270.0030.00316.57
7.4.260.0000.00513.27
7.4.250.0120.00416.33
7.4.240.0170.00016.42
7.4.230.0150.00016.40
7.4.220.0050.01116.40
7.4.210.0090.00916.46
7.4.200.0090.00616.48
7.4.190.0070.00716.59
7.4.180.0080.00816.61
7.4.160.0150.00016.42
7.4.150.0120.00416.45
7.4.140.0070.00916.37
7.4.130.0060.00916.31
7.4.120.0160.00016.43
7.4.110.0120.00416.44
7.4.100.0050.01116.45
7.4.90.0130.00516.39
7.4.80.0100.00516.45
7.4.70.0160.00016.34
7.4.60.0150.00016.39
7.4.50.0070.00716.32
7.4.40.0080.00616.20
7.4.30.0110.00516.28
7.4.20.0120.00316.46
7.4.10.0120.00416.36
7.4.00.0060.00816.40
7.3.330.0040.00416.33
7.3.320.0030.00313.32
7.3.310.0160.00016.12
7.3.300.0100.00316.20
7.3.290.0130.00016.19
7.3.280.0110.00316.23
7.3.270.0100.00316.16
7.3.260.0070.00716.39
7.3.250.0100.00716.27
7.3.240.0060.00616.19
7.3.230.0060.00316.17
7.3.220.0080.00516.05
7.3.210.0060.00615.96
7.3.200.0060.00616.18
7.3.190.0080.00816.20
7.3.180.0120.00316.11
7.3.170.0160.00016.14
7.3.160.0130.00416.04
7.3.150.0090.00816.13
7.3.140.0150.00016.06
7.3.130.0170.00016.26
7.3.120.0150.00016.34
7.3.110.0120.00416.17
7.3.100.0110.00416.15
7.3.90.0170.00016.53
7.3.80.0100.00616.20
7.3.70.0050.01116.22
7.3.60.0160.00016.38
7.3.50.0100.00716.26
7.3.40.0100.00716.43
7.3.30.0090.00916.24
7.3.20.0130.00418.18
7.3.10.0120.00417.95
7.3.00.0140.00318.05

preferences:
65.22 ms | 401 KiB | 5 Q