3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function whatsThis() { extract(array('this' => 'lol')); var_dump($this); } } $f = new Foo(); $f->whatsThis();
Output for 7.1.0
Fatal error: Uncaught Error: Cannot re-assign $this in /in/Zm6c1:6 Stack trace: #0 /in/Zm6c1(6): extract(Array) #1 /in/Zm6c1(13): Foo->whatsThis() #2 {main} thrown in /in/Zm6c1 on line 6
Process exited with code 255.
Output for 5.2.15 - 5.2.17, 5.3.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
object(Foo)#1 (0) { }
Output for 4.3.0 - 5.2.14, 5.3.0 - 5.3.3
string(3) "lol"