3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class example { public $foo; public function__construct() { $this->function = foo() { return 24; }; } } $exp = new example(); echo ($exp->function)(), PHP_EOL;
based on sBkcd
Output for 7.1.0 - 7.3.0rc3
Parse error: syntax error, unexpected 'function__construct' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/io8rI on line 7
Process exited with code 255.
Output for 5.6.38 - 7.0.28
Parse error: syntax error, unexpected 'function__construct' (T_STRING), expecting variable (T_VARIABLE) in /in/io8rI on line 7
Process exited with code 255.