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(){ $v = &a(); $this = $v; } public function cc(){ echo 'cc'; } } $v = new b(); echo get_class($v); $v->cc(); $v->aa();
Output for 5.3.0 - 5.5.0
Fatal error: Cannot re-assign $this in /in/hS7rK on line 13
Process exited with code 255.