3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Magic { protected $v = array("a" => 1, "b" => 2, "c" => 3); public function &__get($v) { return $this->v[$v]; } } $m = new Magic(); print_r($m->d); $m->d[] = 4; print_r($m->d); echo $m->d[0];
Output for 7.1.6
Array ( [0] => 4 ) 4