3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { private $data = []; public function __set($name, $value) { $this->data[$name] = $value; } public function __isset($name) { return isset($this->data[$name]); } public function __unset($name) { unset($this->data[$name]); } public function __get($name) { return $this->data[$name]; } } $foo = new Foo(); $foo->__set('uno', 'one'); $foo->__set(2, 'two'); var_dump( $foo->uno, $foo->__get(2) );
Output for git.master, git.master_jit, rfc.property-hooks
string(3) "one" string(3) "two"

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:
43.52 ms | 1474 KiB | 4 Q