3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { function b(){ (function(){ echo __CLASS__,' ', __METHOD__, ' ', __FUNCTION__, PHP_EOL; })(); function c(){ echo __CLASS__,' ', __METHOD__, ' ', __FUNCTION__, PHP_EOL; } } } (new a)->b(); c();
based on AY5jS
Output for 7.0.0 - 7.3.0alpha1
a {closure} {closure} a c c
Output for 5.3.18 - 5.6.21
Parse error: syntax error, unexpected '(' in /in/YI4an on line 7
Process exited with code 255.