3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo implements ArrayAccess { public function offsetSet($offset, $value) { var_dump(__METHOD__); } public function offsetExists($var) { var_dump(__METHOD__); if ($var == "foobar") { return true; } return false; } public function offsetUnset($var) { var_dump(__METHOD__); } public function offsetGet($var) { var_dump(__METHOD__); return "value"; } } var_dump($foo['bar']); var_dump(array_key_exists($foo['bar']);
Output for 5.3.0 - 5.4.21
Parse error: syntax error, unexpected ';' in /in/X4vmh on line 26
Process exited with code 255.