3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Data implements ArrayAccess { public $namespaceScopes = []; // make private public function offsetExists(string $namespace) : bool { return isset($this->namespaceScope[$namespace]); } public function offsetGet(string $namespace) : NamespaceScope { return $this->namespaceScopes[$namespace]; } public function offsetSet(string $namespace, NamespaceScope $namespaceScope) { $this->namespaceScopes[$namespace] = $namespaceScope; } public function offsetUnset(string $namespace) { unset($this->namespaceScopes[$namespace]); } }
Output for 7.0.0 - 7.2.0
Fatal error: Declaration of Data::offsetExists(string $namespace): bool must be compatible with ArrayAccess::offsetExists($offset) in /in/TKImF on line 3
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/TKImF on line 7
Process exited with code 255.