3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = new SplTempFileObject(); for ($i = 0; $i < 100; $i++) { $file->fwrite("Foo $i\n"); } $file->rewind(); $file->key(); $file->current(); function get_line($file) { $triggerNext = $file->next(); $return = array(); $return['line'] = $file->key(); $return['contents'] = trim($file->current()); return $return; } $array = []; $array[] = get_line($file); $array[] = get_line($file); $array[] = get_line($file); echo json_encode($array, JSON_PRETTY_PRINT);
Output for git.master, git.master_jit, rfc.property-hooks
[ { "line": 1, "contents": "Foo 1" }, { "line": 2, "contents": "Foo 2" }, { "line": 3, "contents": "Foo 3" } ]

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:
50.5 ms | 405 KiB | 9 Q