run code in 150+ php & hhvm versions
Bugs & Features
<?php class A{ function A(){ $this->a['s'] = 'hoge'; } function B(){ $s =& $this->a['s']; $this->o($s); var_dump($s); } function o($s){ $s = 'da' . $s; } } $a = new A(); $a->B(); var_dump($a->a['s']);
based on 2rv3M
Output for 7.0.0 - 7.1.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in /in/korqt on line 2 string(4) "hoge" string(4) "hoge"
Output for 4.3.0 - 5.6.28, hhvm-3.12.0
string(4) "hoge" string(4) "hoge"
Output for hhvm-3.10.0

Process exited with code 153.