3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { function __construct() { } function __invoke() { echo("Invoked\n"); } } $a = new a(); $a(); // Prints: Invoked class b { private $x; function __construct() { $this->x = new a(); $this->x(); } } $b = new b(); // Issues error: undefined method b::x
Output for 7.0.0 - 7.2.0
Invoked Fatal error: Uncaught Error: Call to undefined method b::x() in /in/cV3o4:17 Stack trace: #0 /in/cV3o4(21): b->__construct() #1 {main} thrown in /in/cV3o4 on line 17
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Invoked Fatal error: Call to undefined method b::x() in /in/cV3o4 on line 17
Process exited with code 255.