3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function foo() { $f = function () { var_dump(__CLASS__, __METHOD__, __FUNCTION__); }; $f(); } } $a = new A(); $a->foo();
Output for 7.0.0 - 7.2.0
string(1) "A" string(9) "{closure}" string(9) "{closure}"
Output for 5.3.18 - 5.6.28
string(1) "A" string(12) "A::{closure}" string(9) "{closure}"