Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20252 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14598 invoked by uid 1010); 22 Nov 2005 21:29:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14583 invoked from network); 22 Nov 2005 21:29:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Nov 2005 21:29:14 -0000 X-Host-Fingerprint: 195.227.108.51 wfserver02.wf-ppr.de Windows 2000 SP2+, XP SP1 (seldom 98 4.10.2222) Received: from ([195.227.108.51:23915] helo=wfserver02.wf-ppr.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 99/F7-11378-AAD83834 for ; Tue, 22 Nov 2005 16:29:14 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-class: urn:content-classes:message Date: Tue, 22 Nov 2005 22:29:09 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Message-ID: <00A2E2156BEE8446A81C8881AE117F192C1C4F@companyweb> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] PDM Meeting Notes Thread-Index: AcXvpiwKzqITT5y0Tt6VQX/HN2C+BQAAEYmQ To: "Rasmus Lerdorf" Cc: "internals" Subject: AW: [PHP-DEV] PDM Meeting Notes From: mp@webfactory.de ("Matthias Pigulla") > I don't see why you can't specify that a class definition must have a=20 > constructor. Obviously the constructor is not for the=20 > interface itself. Ok, that is, having __construct in the interface asserts that everything you get passed (as an implementation of the interface) has been constructed by a constructor that has a certain signature? :--/ Of course it also doesn't make sense to call __construct on the implementation passed along. Luckily this is nothing I'm forced to write in my code ;). I only wanted to utter I have a Bad Feeling(TM) if you invest time and effort to make stuff like this work if the result is something that seems to make no sense [to me only?]. And once you allow it, be sure ppl out there use & abuse it and will complain should you ever have to remove it again. .. I'm just trying to make up a scenario where the above might make sense - it could be where you have something like a factory method. It has a type hint on it's argument to make sure what gets passed in implements a certain interface. That interface defines the signature of __construct, so the method can construct instances of the "thing" - only knowing that the instances constructed will implement the interface (?), but not knowing their implementation.=20 But how should it construct instances? new INameOfTheInterface()? And besides that, problem is again that the "thing" passed in would have to be something representing a class, and not an instance of the class itself. You could always (gut feeling) re-design this to work "the usual way" by passing in something representing a class and providing behaviour to construct instances. I hope Andi backs me :) -mp.