3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /*echo (function ($x,$y) { return $x + $y; })(4,5); */ class B{ protected function __construct() { echo "__construct of B called".PHP_EOL; } } class A extends B{ function __construct() { echo "__construct of A called".PHP_EOL; } } new A();
based on mQjaG
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
__construct of A called