3v4l.org

run code in 300+ PHP versions simultaneously
<?php class VariableStream { function stream_open($path, $mode, $options, &$opened_path) { return true; } function stream_read($count) { return "x"; } function stream_write($data) { return strlen($data); } function stream_tell() { return 0; } function stream_eof() { return true; } function stream_seek($offset, $whence) { return false; } function stream_metadata($path, $option, $var) { return true; } } stream_wrapper_register("var", "VariableStream") or die("Failed to register protocol"); chmod("var://myvar", 0777); /* $myvar = ""; $fp = fopen("var://myvar", "r+"); fwrite($fp, "line1\n"); fwrite($fp, "line2\n"); fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { echo fgets($fp); } fclose($fp); var_dump($myvar); */
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property VariableStream::$context is deprecated in /in/9fVWl on line 42

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:
61.54 ms | 401 KiB | 8 Q