3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C implements ArrayAccess { public function offsetGet($k) { echo "offsetGet: "; var_dump($k); } public function offsetSet($k, $v) {} public function offsetExists($k) { echo "offsetExists: "; var_dump($k); } public function offsetUnset($k) {} } $x = new C(); var_dump($x['123']); var_dump(isset($x['123']));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of C::offsetExists($k) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bC4tX on line 8 Deprecated: Return type of C::offsetGet($k) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bC4tX on line 3 Deprecated: Return type of C::offsetSet($k, $v) 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/bC4tX on line 7 Deprecated: Return type of C::offsetUnset($k) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/bC4tX on line 12 offsetGet: string(3) "123" NULL offsetExists: string(3) "123" bool(false)

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