3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Foo { class Test { public function tes2t() { var_dump(__FUNCTION__); var_dump(__METHOD__); } } } $t = new Foo\Test(); $t->tes2t();
based on s7D2M
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.6
Fatal error: No code may exist outside of namespace {} in /in/ZfEEa on line 14
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: No code may exist outside of namespace {}: (Line: 14, Char: 20) in /in/ZfEEa:14 Stack trace: #0 {main}
Process exited with code 255.