3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
1. <?php 2. 3. class example 4. { 5. public $foo; 6. 7. public function__construct() { 8. $this->function = foo() { 9. return 24; 10. }; 11. } 12. } 13. $exp = new example(); 14. echo ($exp->function)(), PHP_EOL;
based on nnlQe
Output for 5.6.38 - 7.3.0rc3
Parse error: syntax error, unexpected '3.' (T_DNUMBER) in /in/c0sXN on line 3
Process exited with code 255.