3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class T { private $data; public function a(){ $this->data=['a'=>1,'b'=>'d']; } public function getData(){ return $this->data; } } $t=new T(); $data=$t->getData(); var_dump($data); $t->a(); $data=$t->getData(); var_dump($data); $data['b']=23642562; var_dump($data); $data=$t->getData(); var_dump($data);
based on tmgVk
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0rc3
NULL array(2) { ["a"]=> int(1) ["b"]=> string(1) "d" } array(2) { ["a"]=> int(1) ["b"]=> int(23642562) } array(2) { ["a"]=> int(1) ["b"]=> string(1) "d" }