I already read the related topic here Function with the same name, but with a different signature in the derived class .
I think the problem is the same, but in my case it happens in PHP 5.4 (it works fine in PHP 5.3). The specific configuration is wamp 2.2, PHP 5.4.3. I see no errors in the logs, and the Chrome browser shows the following: "Error 101 (net :: ERR_CONNECTION_RESET): the connection was reset."
If I change the name of the function "init" in my example below, everything will be fine. Therefore, I know what to do, but I would like to make sure that it is bad practice in general for the same reasons explained in the relevant question. It would be helpful if PHP showed an error, I don't know what is going on inside.
Any thoughts?
thanks
class MyClass1 { private function init(){ } } class MyClass2 extends MyClass1 { private function init($params) { } } $myinstance = new MyClass2();
source share