3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Clazz { private $data; public function __construct($data) { $this->data = $data } public function getData() { return $this->data; } } $arr = new \ArrayObject(array(1,2)); $clazz = new Clazz($arr); var_dump($clazz->getData()); $arr->append(3); var_dump($clazz->getData());
Output for 5.3.0 - 5.5.3
Parse error: syntax error, unexpected '}' in /in/c56FS on line 10
Process exited with code 255.