3v4l.org

run code in 300+ PHP versions simultaneously
<?hh class Bar{} class Foo implements ArrayAccess<string, Bar> { public function offsetExists(string $offset): bool { return true;} public function offsetGet(string $offset): Bar { return new Bar();} public function offsetSet(string $offset, Bar $value): this { return $this;} public function offsetUnset(string $offset): this { return $this;} } function main(): void { $x = new Foo(); $x->offsetSet("Hi", new Bar()); }
Output for git.master, git.master_jit, rfc.property-hooks
<?hh class Bar{} class Foo implements ArrayAccess<string, Bar> { public function offsetExists(string $offset): bool { return true;} public function offsetGet(string $offset): Bar { return new Bar();} public function offsetSet(string $offset, Bar $value): this { return $this;} public function offsetUnset(string $offset): this { return $this;} } function main(): void { $x = new Foo(); $x->offsetSet("Hi", new 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:
32.41 ms | 402 KiB | 8 Q