Answer by Danny Michaeli for Fatal error: Call to private...
For me its was that the name of the CLASS was the same name as one of the methodsthat was private...for example...class myClass { public function __construct() { } private function myClass() { }}
View ArticleAnswer by Mogogy for Fatal error: Call to private MyObject::__construct()...
Instead of $x = new MyObject() you could use$x = MyObject::getInstance();assuming that MyObject is a Singleton and getInstance() function is available.
View ArticleAnswer by zombat for Fatal error: Call to private MyObject::__construct()...
Your MyObject class has a protected or private constructor, which means that the class cannot be instantiated. __construct() functions are always called when an object is instantiated, so trying to do...
View ArticleFatal error: Call to private MyObject::__construct() from invalid context
When creating a new object in PHP, I get the following error message:Fatal error: Call to private MyObject::__construct() from invalid contextI just create the new object and do not try to call the...
View Article
More Pages to Explore .....