3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class obj implements ArrayAccess { public function offsetSet($offset, \stdClass $value) { } public function offsetExists($offset) { } public function offsetUnset($offset) { } public function offsetGet($offset) { } } $v = new obj; $v[new stdClass()] = 1;
Output for 7.0.0 - 7.2.6
Fatal error: Declaration of obj::offsetSet($offset, stdClass $value) must be compatible with ArrayAccess::offsetSet($offset, $value) in /in/N0Phe on line 3
Process exited with code 255.
Output for 5.4.1 - 5.6.28
Fatal error: Declaration of obj::offsetSet() must be compatible with ArrayAccess::offsetSet($offset, $value) in /in/N0Phe on line 3
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Fatal error: Declaration of obj::offsetSet() must be compatible with that of ArrayAccess::offsetSet() in /in/N0Phe on line 3
Process exited with code 255.