3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { var $text; function a() { $this->text = 'OK'; } } class b { var $text = 'NOT OK'; function b() { $this = new a(); } } $myClass = new b(); echo $myClass->text; ?>
Output for 5.3.0 - 5.3.19, 5.4.0 - 5.4.9
Fatal error: Cannot re-assign $this in tKhUm on line 11
Process exited with code 255.

preferences:
173.33 ms | 1387 KiB | 37 Q