3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Param extends ArrayObject { public function offsetGet($name) { if (!$this->offsetExists($name)) return null; return parent::offsetGet($name); } } $data = new Param(array('foo' => 12)); var_dump($data['bar'], $data['foo]);
Output for 5.4.0 - 5.5.3
Parse error: syntax error, unexpected ''foo]);' (T_ENCAPSED_AND_WHITESPACE), expecting ']' in /in/76tVc on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /in/76tVc on line 14
Process exited with code 255.