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; (Test::testStatic())->testMethod();
based on bEXL6
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to private StaticClass::__construct() from invalid context in /in/XLpfS:18 Stack trace: #0 {main} thrown in /in/XLpfS on line 18
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/XLpfS on line 19
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/XLpfS on line 19
Process exited with code 255.