Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80797 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24970 invoked from network); 19 Jan 2015 10:39:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2015 10:39:45 -0000 X-Host-Fingerprint: 80.177.120.119 marston-home.demon.co.uk Received: from [80.177.120.119] ([80.177.120.119:20905] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/9B-64889-0FEDCB45 for ; Mon, 19 Jan 2015 05:39:44 -0500 Message-ID: To: internals@lists.php.net References: <0DD30A0D-E7CA-4150-83E0-8FD46635279C@ajf.me> <8761c6280g.fsf@margaine.com> <54B91D16.70901@gmail.com> <78.22.47555.7C24AB45@pb1.pair.com> <1421519637.40188.1.camel@proposaltech.com> <54BABA93.9070809@gmail.com> <3C77D1E5-ACF1-442D-BC84-59E49EFD6A5E@ajf.me> In-Reply-To: <3C77D1E5-ACF1-442D-BC84-59E49EFD6A5E@ajf.me> Date: Mon, 19 Jan 2015 10:39:41 -0000 Lines: 1 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 X-Posted-By: 80.177.120.119 Subject: Re: [PHP-DEV] [RFC] Remove PHP 4 Constructors From: TonyMarston@hotmail.com ("Tony Marston") "Andrea Faulds" wrote in message news:3C77D1E5-ACF1-442D-BC84-59E49EFD6A5E@ajf.me... > > >> On 19 Jan 2015, at 10:05, Tony Marston wrote: >> >> "Marcio Almada" wrote in message >> news:CAOsHV+uhO3OVS-BEQMDjomz4SDWOYjN7ZNMCqMT8BYyNuGQVXw@mail.gmail.com... >>> >>>> Perhaps there should be a new rule which says that invoking a >>>> constructor with anything other than "new" or "parent::__contruct()" >>>> should be illegal, in which case this situation would generate an >>>> error. >>> >>> Now this would break a lot of code that $obj->__construct(); or >>> $this->__construct(); And I've seen a lot of it. >> >> Surely, according to the principles of OO, a class constructor should >> ONLY be called when the class is constructed/instantiated into an object >> via the "new" verb? Google for "class constructor" and you will see all >> those links which say the same thing. > >Inheritance is also an OO principle, and typically a derived class’s >constructor will call the parent’s. That is precisely why I said that "parent::__construct()" should still be legal. >-- >Andrea Faulds >http://ajf.me/ > > > -- Tony Marston