3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class HasInvoke{ public function __invoke() { echo "Invoked!"; } } class Invoker{ /** * @var \HasInvoke */ public $hi; public function __construct() { $this->hi = new HasInvoke();} public function doesStuff() { $this->hi(); } } $a = new Invoker(); $a->doesStuff();
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined method Invoker::hi() in /in/Nuhud:22 Stack trace: #0 /in/Nuhud(27): Invoker->doesStuff() #1 {main} thrown in /in/Nuhud on line 22
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Call to undefined method Invoker::hi() in /in/Nuhud on line 22
Process exited with code 255.