3v4l.org

run code in 300+ PHP versions simultaneously
<?php function accept_array($a) : void { var_dump($a); unset($a); } function return_array() { return new class implements ArrayAccess { public function offsetExists(mixed $offset): bool { return true; } public function offsetGet(mixed $offset): mixed { return 42; } public function offsetSet(mixed $offset, mixed $value): void {} public function offsetUnset(mixed $offset): void {} }; } $input = return_array(); if (isset($input['key'])) { accept_array($input); }
Output for git.master, git.master_jit, rfc.property-hooks
object(ArrayAccess@anonymous)#1 (0) { }

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