Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7673 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13240 invoked by uid 1010); 9 Feb 2004 17:28:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 13216 invoked from network); 9 Feb 2004 17:28:26 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 9 Feb 2004 17:28:26 -0000 Received: from cpanel by iko.gotobg.net with local (Exim 4.24) id 1AqFCv-0000BQ-PD for internals@lists.php.net; Mon, 09 Feb 2004 19:28:29 +0200 Received: from gate.dorten.com (gate.dorten.com [212.9.189.193]) by hristov.com (IMP) with HTTP for ; Mon, 9 Feb 2004 19:28:29 +0200 Message-ID: <1076347709.4027c33db98cc@hristov.com> Date: Mon, 9 Feb 2004 19:28:29 +0200 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 212.9.189.193 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [32001 32001] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com Subject: Changing the visibility of constructors? From: php@hristov.com (Andrey Hristov) Hello internals, what's your opinion on whether the constructors must follow one of the principles of the polymorphism - "The visibility in extending classes must be the same or better". Example : class parent { public function __construct() { } } class child extends parent { private function __construct() { } } Currently this code emits a compilation error. If __construct was just a normal then I won't ask, but since __construct() is the new of naming constructors and they are special methods, which are never callen directly but by the engine internally. So, should it be like this? Andrey P.S. An workaround exists : the constructors must not be named __construct() but must follow the old naming convention. In this case the engine does not complain.