Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25715 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25476 invoked by uid 1010); 15 Sep 2006 06:33:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 25461 invoked from network); 15 Sep 2006 06:33:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2006 06:33:53 -0000 Authentication-Results: pb1.pair.com header.from=tslettebo@broadpark.no; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=tslettebo@broadpark.no; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain broadpark.no from 80.202.4.58 cause and error) X-PHP-List-Original-Sender: tslettebo@broadpark.no X-Host-Fingerprint: 80.202.4.58 osl1smout1.broadpark.no Solaris 9 Received: from [80.202.4.58] ([80.202.4.58:48429] helo=osl1smout1.broadpark.no) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/36-45066-D294A054 for ; Fri, 15 Sep 2006 02:33:53 -0400 Received: from osl1sminn1.broadpark.no ([80.202.4.59]) by osl1smout1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0J5M003R3FIJF860@osl1smout1.broadpark.no> for internals@lists.php.net; Fri, 15 Sep 2006 08:32:43 +0200 (CEST) Received: from pc ([80.203.129.59]) by osl1sminn1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with SMTP id <0J5M005EKFIJ9V30@osl1sminn1.broadpark.no> for internals@lists.php.net; Fri, 15 Sep 2006 08:32:43 +0200 (CEST) Date: Fri, 15 Sep 2006 08:33:05 +0200 To: Marcus Boerger Cc: RQuadling@GoogleMail.com, internals@lists.php.net Message-ID: <003401c6d890$cd44b480$9a02a8c0@pc> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Mailer: Microsoft Outlook Express 6.00.2800.1807 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal References: <0a1301c6d64f$8af01c70$a900000a@adstate.local> <00b501c6d6b4$632b7e90$9a02a8c0@pc> <10845a340609130053n395632f4ka5bbed3e49ce6ad2@mail.gmail.com> <0d4001c6d71a$fa124260$a900000a@adstate.local> <45081ABF.2020804@dealnews.com> <005301c6d768$7a5fb0e0$9a02a8c0@pc> <45087C81.3030008@dealnews.com> <006701c6d7c2$414424d0$9a02a8c0@pc> <45096A7D.3070706@dealnews.com> <003e01c6d825$92fc36b0$9a02a8c0@pc> <10845a340609141157g71bcf577ge2b9c0feefa1a961@mail.gmail.com> <008501c6d836$976acbb0$9a02a8c0@pc> <1474446553.20060914223353@marcus-boerger.de> Subject: Re: [PHP-DEV] Re: Why isn't base class constructors or destructors required to be called? (was: Re: [PHP-DEV] Return type hints) From: tslettebo@broadpark.no (=?iso-8859-1?Q?Terje_Sletteb=F8?=) > >> When would the constructor be called automatically? I've used Delphi > >> and you use the inherit verb (or inherited - long time ago - can't > >> remember exactly). In PHP parent::__construct (though I think > >> parent::__METHOD__ would be cleaner as this removes ambiguity on the > >> actual name for all inherited methods). > > > Well, let's look at C++, which I'm most familiar with. > > PHP is not C++ Ah, I was kind of waiting for that one... :) Yet, that says absolutely nothing about why PHP works the way it does. > and speaking of constructors and destrcutors PHP goes morethe Delphi way. If constructors/destructors are not "the PHP way", then why even have them? > We do not claim to follow any other language precisely, PHP is > it's own language with its own feature set. Naturally, but is it unreasonable to think that there's a reason for the way things work in PHP...? And to ask _why_ PHP doesn't let you ensure that a class has its constructor/destructor called? Why implement constructors/destructors in such a way that they may - or may not - be called? "Do you feel lucky?" Regards, Terje