3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { function b(){ $fn = function(){ echo __CLASS__,' ', __METHOD__, ' ', __FUNCTION__, PHP_EOL; }; $fn(); function c(){ echo __CLASS__,' ', __METHOD__, ' ', __FUNCTION__, PHP_EOL; } } } (new a)->b(); c();
based on YI4an
Output for 7.0.0 - 7.2.0
a {closure} {closure} a c c
Output for 5.4.0 - 5.6.28
a a::{closure} {closure} a a::c c