3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class a{ public function __construct(){ echo 'sub_class'; } public function aa(){ echo 'aa'; } } class b{ public function __construct(){ $this = &a(); } public function cc(){ echo 'cc'; } } $v = new b(); echo get_class($v); $v->cc(); $v->aa();
Output for 5.3.0 - 5.4.17
Fatal error: Cannot re-assign $this in /in/GMIHW on line 12
Process exited with code 255.