3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $resource; public function __construct($path) { $this->resource = fopen($path, 'rb'); } public function __destruct() { fwrite(STDOUT, sprintf('BYE BYE %s%s', get_class($this), PHP_EOL)); } } class Bar { private $cl; private $resource; public function __construct($path) { $this->resource = fopen($path, 'rb'); $this->cl = function () {}; } public function __destruct() { fwrite(STDOUT, sprintf('BYE BYE %s%s', get_class($this), PHP_EOL)); } } function get_path($resource) { $ctx = stream_get_meta_data($resource); return $ctx['uri']; } $foo = new Foo(__FILE__); $bar = new Bar(__FILE__); unset($bar); unset($foo);
Output for git.master, git.master_jit, rfc.property-hooks
BYE BYE Foo BYE BYE Bar

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:
27.88 ms | 405 KiB | 5 Q