3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function __construct() { $b = new Bar(function() use ($this) { var_dump($this); }); } } class Bar { public function __construct($callable) { call_user_func($callable); } } $f = new Foo;
Output for 5.3.0 - 5.5.12
Fatal error: Cannot use $this as lexical variable in /in/aBegX on line 8
Process exited with code 255.