3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fileHandle = fopen('php://memory', 'r+'); $string = '<?php class Foo { public function __construct($x) { $this->x = $x; } }'; rewind($fileHandle); fwrite($fileHandle, '$string'); include 'php://memory'; $test = new Foo(5);

preferences:
36.58 ms | 402 KiB | 5 Q