3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Output for 5.3.19 - 7.3.1
Array ( )