3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class x { function y() { function z(){ echo 'Hello world'; } } } $x = new x; var_dump(function_exists('z')); $x->y(); var_dump(function_exists('z'), z());
based on kPAjP
Output for 4.3.0 - 4.4.9, 5.0.5 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
bool(false) Hello worldbool(true) NULL
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.0.4
bool(false) Fatal error: Non-static method x::z() cannot be called statically in /in/uPTkA on line 14
Process exited with code 255.