3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo extends PDO { private function __construct() {} public static function getInstance() { return new self(); } public function bar() { return 'baz'; } } $foo = Foo::getInstance(); echo $foo->bar();
Output for 5.3.0 - 5.4.28
Fatal error: Access level to Foo::__construct() must be public (as in class PDO) in /in/q5CYc on line 10
Process exited with code 255.