3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements ArrayAccess { public function offsetGet($x) { var_dump($x); } public function offsetExists($x) { var_dump($x); } public function offsetSet($x, $y) { var_dump($x); } public function offsetUnset($x) { var_dump($x); } } $foo = new Foo(); echo "$foo[0]"; echo "$foo[1]"; echo "$foo[00]";
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of Foo::offsetExists($x) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/qU9E9 on line 7 Deprecated: Return type of Foo::offsetGet($x) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/qU9E9 on line 4 Deprecated: Return type of Foo::offsetSet($x, $y) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/qU9E9 on line 10 Deprecated: Return type of Foo::offsetUnset($x) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/qU9E9 on line 13 int(0) int(1) string(2) "00"

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:
55.93 ms | 403 KiB | 8 Q