3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); const LINES = 5; const INDEX = 10; $file_01 = new SplTempFileObject(); $file_02 = new SplFileObject('/tmp/test.txt', 'w+'); // write to files for ($i = 0; $i < LINES; $i++) { $file_01->fwrite("line {$i}" . PHP_EOL); $file_02->fwrite("line {$i}" . PHP_EOL); } // reset $file_01->rewind(); $file_02->rewind(); // seek $file_01->seek(INDEX); $file_02->seek(INDEX); // show results echo 'file_01: ' . $file_01->key(), PHP_EOL; echo 'file_02: ' . $file_02->key(), PHP_EOL;
Output for git.master_jit, git.master, rfc.property-hooks
file_01: 4 file_02: 5

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
92.6 ms | 405 KiB | 5 Q