3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Factory { function capitalizer() { return function ($name) { return static::capitalize($name); } } static function capitalize($name) { return strtoupper($name); } } $factory = new Factory(); $capitalizer = $factory->capitalizer(); var_dump($capitalizer('wat'));
Output for 5.3.0 - 5.4.23
Parse error: syntax error, unexpected '}' in /in/hAoP5 on line 8
Process exited with code 255.