3v4l.org

run code in 200+ php & hhvm versions
<?php class myclass { public $arr = array(); public function myfunc(){ $this->arr[1] = 'one'; $this->arr[2] = 'two'; } } $obj = new myclass; print_r($obj->arr);
based on iKVn4