3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); const LINES = 5; const INDEX = 10; $file = new SplFileObject('/tmp/test.txt', 'w+'); // write to files for ($i = 0; $i < LINES; $i++) { $file->fwrite("line {$i}" . PHP_EOL); } // behaviour of next() $file->rewind(); for ($i = 0; $i < INDEX; $file->next(), $i++); echo 'next(): ', $file->key(), PHP_EOL; // behaviour of seek() $file->rewind(); $file->seek(INDEX); echo 'seek(): ', $file->key(), PHP_EOL;

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.10.0090.00818.76
8.5.00.0140.00819.90
8.4.150.0020.00014.05
8.4.140.0100.01117.66
8.4.130.0100.01018.75
8.4.120.0140.00719.45
8.4.110.0120.00619.88
8.4.100.0130.00917.69
8.4.90.0130.00720.57
8.4.80.0050.00318.67
8.4.70.0110.00520.59
8.4.60.0080.01218.64
8.4.50.0060.00518.88
8.4.40.0130.00719.18
8.4.30.0060.00920.15
8.4.20.0210.00019.66
8.4.10.0070.01420.38
8.3.280.0080.01218.46
8.3.270.0100.01016.55
8.3.260.0090.00916.50
8.3.250.0110.01016.62
8.3.240.0130.00616.53
8.3.230.0110.00916.55
8.3.220.0050.00318.92
8.3.210.0090.00616.46
8.3.200.0100.01016.59
8.3.190.0140.00517.04
8.3.180.0050.01416.48
8.3.170.0100.00018.85
8.3.160.0120.00316.92
8.3.150.0100.00317.16
8.3.140.0000.00816.71
8.3.130.0130.00318.36
8.3.120.0080.00020.80
8.3.110.0100.01018.25
8.3.100.0040.00416.66
8.3.90.0060.00326.77
8.3.80.0060.00316.50
8.3.70.0060.01216.58
8.3.60.0070.01116.75
8.3.50.0110.00419.99
8.3.40.0170.00318.64
8.3.30.0140.00019.20
8.3.20.0050.00224.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0090.00616.66
8.2.280.0120.00818.16
8.2.270.0030.01517.32
8.2.260.0130.00716.51
8.2.250.0090.00018.52
8.2.240.0070.01116.97
8.2.230.0030.00620.94
8.2.220.0060.00324.06
8.2.210.0090.00026.77
8.2.200.0070.00318.67
8.2.190.0100.01018.50
8.2.180.0120.00325.92
8.2.170.0100.01018.79
8.2.160.0100.00322.96
8.2.150.0110.00725.66
8.2.140.0070.00024.66
8.2.130.0030.00626.16
8.2.120.0080.00021.10
8.2.110.0070.00319.21
8.2.100.0120.00017.56
8.2.90.0000.00819.52
8.2.80.0000.00820.54
8.2.70.0250.00079.33
8.2.60.0150.00479.33
8.2.50.0090.00979.33
8.2.40.0130.00379.33
8.2.30.0120.00679.33
8.2.20.0140.00379.33
8.2.10.0110.00779.33
8.2.00.0160.00079.33
8.1.330.0140.00516.11
8.1.320.0110.00916.14
8.1.310.0030.00516.78
8.1.300.0110.00716.91
8.1.290.0030.00630.84
8.1.280.0090.00625.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0030.00628.09
8.1.240.0060.00322.14
8.1.230.0110.00020.91
8.1.220.0050.00317.76
8.1.210.0000.00818.92
8.1.200.0130.00479.33
8.1.190.0170.00079.33
8.1.180.0160.00079.33
8.1.170.0120.00479.33
8.1.160.0110.00479.33
8.1.150.0130.00379.33
8.1.140.0120.00579.33
8.1.130.0130.00379.33
8.1.120.0110.00679.33
8.1.110.0080.00879.33
8.1.100.0120.00479.33
8.1.90.0140.00279.33
8.1.80.0150.00379.33
8.1.70.0120.00479.33
8.1.60.0130.00579.33
8.1.50.0170.00079.33
8.1.40.0120.00679.33
8.1.30.0120.00479.33
8.1.20.0190.00079.33
8.1.10.0120.00879.33
8.1.00.0140.00579.33
8.0.300.0050.00219.89
8.0.290.0120.00479.33
8.0.280.0050.01479.33
8.0.270.0080.00879.33
8.0.260.0130.00379.33
8.0.250.0100.00779.33
8.0.240.0100.00879.33
8.0.230.0160.00079.33
8.0.220.0130.00479.33
8.0.210.0030.01379.33
8.0.200.0130.00579.33
8.0.190.0170.00079.33
8.0.180.0130.00479.33
8.0.170.0100.00779.33
8.0.160.0140.00379.33
8.0.150.0110.00779.33
8.0.140.0180.00079.33
8.0.130.0120.00479.33
8.0.120.0110.00579.33
8.0.110.0130.00379.33
8.0.100.0090.00979.33
8.0.90.0130.00379.33
8.0.80.0130.00379.33
8.0.70.0110.00679.33
8.0.60.0120.00479.33
8.0.50.0170.00079.33
8.0.30.0100.00779.33
8.0.20.0130.00379.33
8.0.10.0140.00379.33
7.4.330.0100.00379.33
7.4.320.0100.01079.33
7.4.300.0140.00579.33
7.4.290.0170.00079.33
7.4.280.0080.00879.33
7.4.270.0170.00079.33
7.4.260.0070.00779.33
7.4.250.0130.00379.33
7.4.240.0080.00879.33
7.4.230.0110.00579.33
7.4.220.0160.00079.33
7.4.210.0050.01179.33
7.4.200.0130.00379.33
7.4.190.0080.00879.33
7.4.180.0080.00879.33
7.4.160.0150.00079.33
7.4.150.0120.00379.33
7.4.140.0100.00579.33
7.4.130.0160.00079.33
7.4.120.0080.00879.33
7.4.110.0070.00779.33
7.4.100.0090.00579.33
7.4.90.0140.00379.33
7.4.80.0110.00579.33
7.4.70.0050.01079.33
7.4.60.0160.00079.33
7.4.50.0050.01079.33
7.4.40.0140.00079.33
7.4.30.0120.00279.33
7.4.20.0080.00879.33
7.4.10.0090.00679.33
7.4.00.0080.00879.33

preferences:
39.45 ms | 403 KiB | 5 Q