3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExtendedArrayAccess implements ArrayAccess { private $data = array(); function __construct(array $array = array()) { $this->data = $array; } function offsetExists($offset) { return array_key_exists($offset, $this->data); } function offsetGet($offset) { return $this->data[$offset]; } function offsetSet($offset, $value) { $this->data[$offset] = $value; } function offsetUnset($offset) { unset($this->data[$offset]); } } $array = new ExtendedArrayAccess(); $array[0] = null; assert(isset($array[0]) === false); assert(empty($array[0]) === true);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of ExtendedArrayAccess::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/tMg3l on line 8 Deprecated: Return type of ExtendedArrayAccess::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/tMg3l on line 11 Deprecated: Return type of ExtendedArrayAccess::offsetSet($offset, $value) 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/tMg3l on line 14 Deprecated: Return type of ExtendedArrayAccess::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/tMg3l on line 17 Fatal error: Uncaught AssertionError: assert(isset($array[0]) === false) in /in/tMg3l:24 Stack trace: #0 /in/tMg3l(24): assert(false, 'assert(isset($a...') #1 {main} thrown in /in/tMg3l on line 24
Process exited with code 255.

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.09 ms | 402 KiB | 8 Q