3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Example { private $variable; public function __construct($variable) { $this->variable = fopen('php://memory', 'rw+'); fwrite($this->variable, $variable); } public function example() { return file_get_content($this->variable); } public function setExample($variable) { fwrite($this->variable, $variable); } public function __destruct() { fclose($this->variable); } } $example = new Example('first'); print $example->example() . PHP_EOL; $example->setExample('second'); print $example->example() . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function file_get_content() in /in/bGf5k:15 Stack trace: #0 /in/bGf5k(31): Example->example() #1 {main} thrown in /in/bGf5k on line 15
Process exited with code 255.

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