3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Token { protected $name; protected $closure; public function __construct($name, \Closure $closure) { $this->name = $name; $this->closure = $closure; } public function execute() { return call_user_func_array($this->closure, func_get_args()); } } $token = new Token('test', function($test) { return "123".$test; }; echo $token->execute();
Output for 5.3.0 - 5.4.26
Parse error: syntax error, unexpected ';' in /in/PHOW6 on line 18
Process exited with code 255.