3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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($v = &$array[0]) === false); assert(empty($array[0]) === true);
Output for hhvm-3.10.0 - 3.12.0
Output for 5.3.0 - 5.4.28
Parse error: syntax error, unexpected '=', expecting ',' or ')' in /in/0pANi on line 24
Process exited with code 255.