3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class StaticClass { private function __construct() {} private function StaticClass() {} private function __clone() {} } class Test extends StaticClass { public function testMethod() { echo "testwort"; } public static function testStatic() { return new self(); } } $test = new Test;
based on sPQF1
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to private StaticClass::__construct() from invalid context in /in/bEXL6:18 Stack trace: #0 {main} thrown in /in/bEXL6 on line 18
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Call to private StaticClass::__construct() from invalid context in /in/bEXL6 on line 18
Process exited with code 255.